OFFSET
0,2
COMMENTS
I.e., a(n) is the least solution to n^2 + (x(x+1)(2x+1)/6) = w^2; a(n) is the length of shortest sum of consecutive squares from 1 to a(n) which when added to n^2 gives a new square.
FORMULA
n^2 + (1 + 4 + 9 + ... + a(n)^2) = w^2, where w depends also on n; i.e., sum of consecutive squares from 1, 4, ... to a(n)^2 + n^2 is also a square.
EXAMPLE
n = 3: a(3) = 5 because n^2 + 1 + 4 + 9 + 16 + 25 = 9 + (1 + 4 + 9 + 16 + 25) = 64 = 8*8; n = 4: a(4) = 767 because n^2 + (1 + 4 + ... + 767^2) = 150700176 = 12276*12726, where 767 is the length of the shortest such consecutive-square sequence which provides (when summed) a new square, namely 12276^2. Often the least solution is rather large. E.g., at n = 93, a(n) = 415151, which means that 93^2 + A000330(415151) = 8649 + (long square sum) = 154436265^2 = 23850559947150225 is the smallest such square number, sum odd distinct consecutive squares except one repetition(8649).
MATHEMATICA
s=n^2 Do[s=s+m^2; If[IntegerQ[Sqrt[s]], Print[m]], {m, 1, 500000}] (* gives solutions of which the smallest is entered into the sequence *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Labos Elemer, Nov 07 2001
STATUS
approved