OFFSET
1,2
COMMENTS
Hans Havermann found that the sequence is not a permutation of the integers since a(708)=a(1276)=1666.
LINKS
Melvin Peralta, Table of n, a(n) for n = 1..20000
MATHEMATICA
seq = {1, 2}; max; n = 3; While[n < max, If[MemberQ[seq, Floor[Sqrt[Last[seq]]]] == False, AppendTo[seq, Floor[Sqrt[Last[seq]]]], AppendTo[seq, Last[seq] + Part[seq, n - 2]]]; n++]
PROG
(PARI) A268962_vec=A268962_used=[1, 2]; A268962(n)={ #A268962_vec>=n || A268962_vec=concat(A268962_vec, vector(n-#A268962_vec)); A268962_vec[n] || for(n=#A268962_used+A268962_used[1], n, A268962_vec[n]&&next; (A268962_vec[n-1]<(A268962_used[1]+1)^2 || setsearch(A268962_used, A268962_vec[n]=sqrtint(A268962_vec[n-1]))) && A268962_vec[n]=A268962_vec[n-1]+A268962_vec[n-2]; A268962_used=setunion(A268962_used, A268962_vec[n..n]); while(#A268962_used>1 && A268962_used[2]==A268962_used[1]+1, A268962_used=A268962_used[^1])); A268962_vec[n]} \\ M. F. Hasler, Feb 16 2016
CROSSREFS
KEYWORD
nonn
AUTHOR
Melvin Peralta, Feb 16 2016
STATUS
approved