Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #16 Nov 16 2017 09:39:07
%S 14,29,30,50,54,55,77,86,90,91,110,126,135,139,140,149,174,190,194,
%T 199,203,204,230,245,255,271,280,284,285,294,302,330,355,365,366,371,
%U 380,384,385,415,434,446,451,476,492,501,505,506,509,510,534,559,590,595
%N Numbers that can be written as a sum of at least 3 consecutive squares.
%C Numbers of the form (a(a+1)(2a+1)-b(b+1)(2b+1))/6 where a >= b+3 and b >= 0. - _Robert Israel_, Jul 18 2017
%H Robert Israel, <a href="/A174070/b174070.txt">Table of n, a(n) for n = 1..10000</a>
%e 14 = 1^2 + 2^2 + 3^2, 29 = 2^2 + 3^2 + 4^2.
%e 30 = 1^2 + 2^2 + 3^2 + 4^2, 50 = 3^2 + 4^2 + 5^2.
%p N:= 1000: # to get all terms <= N
%p R:= [seq(b*(b+1)*(2*b+1)/6, b=0..ceil(sqrt(N/3)))]:
%p sort(convert(select(`<=`, {seq(seq(R[i]-R[j],j=1..i-3),i=1..nops(R))},N),list)); # _Robert Israel_, Jul 18 2017
%t max=50^2;lst={};Do[z=n^2+(n+1)^2;Do[z+=(n+x)^2;If[z>max,Break[]];AppendTo[lst,z],{x,2,max/2}],{n,max/2}];Union[lst]
%t (* Second program: *)
%t Function[s, Function[t, Union@ Flatten@ Map[TakeWhile[#, # < t[[1, -1]] &] &, t]]@ Map[Total /@ Partition[s, #, 1] &, Range[3, Length@ s]]][Range[16]^2] (* _Michael De Vlieger_, Jul 18 2017 *)
%t Module[{nn=30,sq},sq=Range[nn]^2;Take[Union[Flatten[Table[Total/@ Partition[ sq,n,1],{n,3,nn-2}]]],2nn]] (* _Harvey P. Dale_, Nov 16 2017 *)
%Y Cf. A111774, A138591, A174069.
%K nonn
%O 1,1
%A _Vladimir Joseph Stephan Orlovsky_, Mar 06 2010