login
A268962
a(1) = 1 and a(2) = 2; thereafter a(n+1) = floor[sqrt(a(n))] if not already in the sequence; otherwise a(n+1) = a(n) + a(n-1).
1
1, 2, 3, 5, 8, 13, 21, 4, 25, 29, 54, 7, 61, 68, 129, 11, 140, 151, 12, 163, 175, 338, 18, 356, 374, 19, 393, 412, 20, 432, 452, 884, 1336, 36, 6, 42, 48, 90, 9, 99, 108, 10, 118, 128, 246, 15, 261, 16, 277, 293, 17, 310, 327, 637, 964, 31, 995, 1026, 32
OFFSET
1,2
COMMENTS
Hans Havermann found that the sequence is not a permutation of the integers since a(708)=a(1276)=1666.
LINKS
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