[go: up one dir, main page]

login
A174070
Numbers that can be written as a sum of at least 3 consecutive squares.
5
14, 29, 30, 50, 54, 55, 77, 86, 90, 91, 110, 126, 135, 139, 140, 149, 174, 190, 194, 199, 203, 204, 230, 245, 255, 271, 280, 284, 285, 294, 302, 330, 355, 365, 366, 371, 380, 384, 385, 415, 434, 446, 451, 476, 492, 501, 505, 506, 509, 510, 534, 559, 590, 595
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
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
STATUS
approved