OFFSET
1,1
LINKS
Sierpinski W., Elementary theory of numbers, Monografie Matematyczne 42 (1964), Chapter II, p. 63.
FORMULA
For n>2, a(n) = (a(1)^2 + a(2)^2 + ... + a(n-1)^2 - 1)/2 = ((a(n-1) + 1)^2 - 1)/2. - Max Alekseyev, Nov 23 2012
a(n) = A053630(n-1)-1 for n>=2. - R. J. Mathar, Apr 23 2007
EXAMPLE
a(2)=4 because (3^2+4^2=5^2) and (4+1=5), a(3)=12 because (3^2+4^2+12^2=13^2) and (12+1=13) a(5)= 3612 because (3^2+4^2+12^2+84^2+3612^2=3613^2) and (3612+1=3613) etc.
MATHEMATICA
a = {3}; For[k = 1 + a[[Length[a]]], Length[a] < 5, While[ ! ((IntegerQ[Sqrt[(k)^2 + Sum[(a[[t]])^2, {t, 1, Length[a]}]]]) && (Sqrt[(k)^2 + Sum[(a[[t]])^2, {t, 1, Length[a]}]] == k + 1)), k++ ]; AppendTo[a, k]]; a
a = {3}; For[k = 1 + a[[Length[a]]], Length[a] < 12, s2 = Plus @@ (a^2); t = Reduce[{y^2 + s2 == (y + 1)^2}, y, Integers]; t = t /. {Equal -> Rule}; k = y /. t; AppendTo[a, k]]; a (* Daniel Huber *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Artur Jasinski, Jan 23 2007, Jan 29 2007
STATUS
approved