A105822 For n > 2, a(n) > 0 not appeared previously is such that a(n-1)^2+4*a(n-2)*a(n) = d^2 is a minimal square, a(1)=1, a(2)=2.
1, 2, 3, 5, 8, 4, 12, 7, 10, 17, 6, 11, 21, 32, 13, 19, 14, 33, 20, 28, 24, 27, 42, 40, 18, 9, 35, 44, 39, 54, 48, 22, 15, 37, 52, 89, 30, 59, 23, 36, 99, 70, 16, 86, 47, 45, 92, 65, 157, 34, 123, 135, 222, 56, 136, 82, 29, 53, 102, 155, 25, 130, 87, 43, 170, 213, 63, 150, 57
Offset: 1
Keywords
Links
- Ivan Neretin, Table of n, a(n) for n = 1..10000
Programs
-
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 *)
Comments