OFFSET
1,3
COMMENTS
The corresponding squares are 1, 9, 16, 25, 36, 64, 100, 121, 144, 169, 196, 256, 289, 361, 400, 441, 529, 576, 625, 676, 729, 841, 961, 1024, 1089, 1156, 1225, 1296, 1369, ...
This is a permutation of the integers.
LINKS
EXAMPLE
a(1) = 0 plus the next single term 1 is 1 = 1^2;
a(2) = 1 plus the next two terms (2,6) is 9 = 3^2;
a(3) = 2 plus the next three terms (6,3,5) is 16 = 4^2;
a(4) = 6 plus the next four terms (3,5,4,7) is 25 = 5^2.
MAPLE
nn:=100:T:=array(1..nn):T[1]:=0:T[2]:=1:kk:=2:lst:={0, 1}:
for n from 2 to nn do:
ii:=0:
for k from 2 to 1000 while(ii=0)do:
if {k} intersect lst = {}
then
ii:=1:lst:=lst union {k}:kk:=kk+1:T[kk]:=k:
else
fi:
od:
jj:=0:n0:=nops(lst):s:=sum('T[i]', 'i'=n..n0):
for p from 1 to 100 while(jj=0) do:
z:=sqrt(s+p):
if z = floor(z) and {p} intersect lst={}
then
jj:=1:lst:=lst union {p}:kk:=kk+1:T[kk]:=p:
else
fi:
od:
od:
print(T):
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Lagneau, Jun 16 2015
STATUS
approved