OFFSET
1,2
LINKS
Giovanni Resta, Table of n, a(n) for n = 1..200
FORMULA
a(n) = A141391(n)^2
EXAMPLE
a(1) = 1.
a(2) is the smallest unused square such that (a(2)+a(1))/2 is a square. So, a(2) = 49.
a(3) is the smallest unused square such that (a(3)+a(2)+a(1))/3 is a square. So, a(3) = 25.
...and so on.
PROG
(Python)
def Sq(x):
..for n in range(10**15):
....if x == n**2:
......return True
....if x < n**2:
......return False
..return False
def SqAve(init):
..print(init)
..lst = []
..lst.append(init)
..n = 1
..while n < 10**9:
....if n**2 not in lst:
......if Sq(((sum(lst)+n**2)/(len(lst)+1))):
........print(n**2)
........lst.append(n**2)
........n = 1
......else:
........n += 1
....else:
......n += 1
SqAve(1)
CROSSREFS
KEYWORD
nonn
AUTHOR
Derek Orr, Jan 20 2014
STATUS
approved