OFFSET
1,1
COMMENTS
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
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
14 = 1^2 + 2^2 + 3^2, 29 = 2^2 + 3^2 + 4^2.
30 = 1^2 + 2^2 + 3^2 + 4^2, 50 = 3^2 + 4^2 + 5^2.
MAPLE
N:= 1000: # to get all terms <= N
R:= [seq(b*(b+1)*(2*b+1)/6, b=0..ceil(sqrt(N/3)))]:
sort(convert(select(`<=`, {seq(seq(R[i]-R[j], j=1..i-3), i=1..nops(R))}, N), list)); # Robert Israel, Jul 18 2017
MATHEMATICA
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]
(* Second program: *)
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 *)
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 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Vladimir Joseph Stephan Orlovsky, Mar 06 2010
STATUS
approved