OFFSET
1,2
COMMENTS
Is it a permutation of positive integers? Among first 2000 terms, first missing numbers are 233, 349, 394, 443, 449.
The sequence depends on seed terms a(1) and a(2); if a(1) = 1, a(3) = a(2)+1.
Values of d^2 in A105823.
LINKS
Ivan Neretin, Table of n, a(n) for n = 1..10000
MAPLE
N:= 1000: # to get a(1) to a(N)
S:= 'S':
a[1]:= 1: a[2]:= 2:
S[1]:= 1: S[2]:= 1:
for n from 3 to N do
ds:= map(t -> rhs(op(t)), [msolve(x^2=a[n-1]^2, 4*a[n-2])]);
xmin:= infinity;
for d in ds do
found:= false;
for y from floor((a[n-1]-d)/(4*a[n-2]))+1 do
xy:= 4*a[n-2]*y + d;
cand:= (xy^2 - a[n-1]^2)/(4*a[n-2]);
if cand >= xmin then found:= false; break fi;
if not assigned(S[cand]) then found:= true; break fi;
od:
if found then xmin:= cand; fi;
od:
a[n]:= xmin;
S[xmin]:= 1;
od:
seq(a[n], n=1..N); # Robert Israel, May 11 2015
MATHEMATICA
a = {1, 2}; Do[i = 1; While[MemberQ[a, i] || !IntegerQ[Sqrt[a[[-1]]^2 + 4 a[[-2]]*i]], i++]; AppendTo[a, i], {n, 3, 70}]; a (* Ivan Neretin, May 11 2015 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Zak Seidov, Apr 22 2005
STATUS
approved