login
A236247
Sequence of distinct least squares such that the arithmetic mean of the first n squares is also a square.
1
1, 49, 25, 121, 784, 196, 33124, 4900, 4, 4356, 2304324, 213444, 2371600, 379456, 87616, 360000, 3802500, 562500, 100, 532900, 5456896, 767376, 5934096, 992016, 9947716, 1350244, 32467204, 44100, 2414916, 10458756, 2683044
OFFSET
1,2
LINKS
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
Sequence in context: A305045 A065787 A033369 * A299470 A226608 A027647
KEYWORD
nonn
AUTHOR
Derek Orr, Jan 20 2014
STATUS
approved