# Python 2.7.7 Code
# Jonathan Frech 13th of July, 2016
#         edited 15th of July, 2016

# Triangular square numbers
# a*(1+a)/2 == b**2

# Mathematica Code
# n=0;p=1;While[True,n+=p;p++;If[Mod[Sqrt[n],1]==0,Print[n]]]

# OEIS
# http://oeis.org/A001110

# def a(n):
# 	if n in [1, 0]:
# 		return n
# 	return 6*a(n-1)-a(n-2)

# Mathematica Code
# a[0]=0;a[1]=1;a[n_]:=6*a[n-1]-a[n-2]

# import math module
import math

# variables to calculate triangular numbers
n = 0
p = 1

# while loop
while True:
	# test if triangular number is a square number
	if math.sqrt(n) % 1 == 0:
		print int(math.sqrt(n))

	# calculate triangular number
	n += p
	p += 1
