%I #3 Mar 30 2012 17:22:33
%S 5,13,25,35,39,41,51,61,85,111,113,143,145,160,181,221,265,313,365,
%T 421,481,545,613,685,761,841,856,925,1013,1105,1201,1301,1405,1513,
%U 1625,1741,1861,1985,2113,2245,2251,2381,2471,2521,2611,2665,2813,2965,3031
%N Numbers n such that there are integers a < b with a^2+(a+1)^2+...+(n-1)^2 = n^2+(n+1)^2+...+b^2.
%C A094551 generalized to squares. Compare to A094552, which has far fewer solutions. For many values of n (5, 13, 25, 41, 61, 85,...), the value of b-a increases by 2 for each successive n. These n are the same as A001844. In other words, when n=i^2+(i+1)^2, then a=n-i-1 and b=n+i-1. The other values of n (35, 39, 51, 111, 143, 160, 856,...), A094523, have comparatively large values of b-a.
%e 13 is in this sequence because 10^2+11^2+12^2 = 13^2+14^2.
%t lst={}; Do[i1=n-1; i2=n; s1=i1^2; s2=i2^2; While[i1>1 && s1!=s2, If[s1<s2, i1--; s1=s1+i1^2, i2++; s2=s2+i2^2]]; If[s1==s2, AppendTo[lst, n]], {n, 2, 4000}]; lst
%Y Cf. A001844 (sum of two consecutive squares), A094550, A094551, A094552, A094523.
%K nonn
%O 1,1
%A _T. D. Noe_, May 10 2004