OFFSET
1,2
COMMENTS
These are the only possibilities for a sum of the first n squares to equal a triangular number.
From Seiichi Manyama, Aug 25 2019: (Start)
The complete list of solutions to k*(k+1)*(2*k+1)/6 = m*(m+1)/2 is as follows.
(k,m) = (-1, 0), (0, 0), (1, 1), (5, 10), (6, 13), (85, 645),
(-1,-1), (0,-1), (1,-2), (5,-11), (6,-14), (85,-646). (End)
REFERENCES
E. T. Avanesov, The Diophantine equation 3y(y+1) = x(x+1)(2x+1), Volz. Mat. Sb. Vyp., 8 (1971), 3-6.
R. K. Guy, Unsolved Problems in Number Theory, Section D3.
Joe Roberts, Lure of the Integers, page 245 (entry for 645).
LINKS
R. Finkelstein, H. London, On triangular numbers which are sums of consecutive squares, J. Number Theory 4 (1972), 455-462.
Eric Weisstein's World of Mathematics, Square Pyramidal Number
EXAMPLE
1^2 + 2^2 + 3^2 + 4^2 + 5^2 = 1 + 2 + 3 + ... + 10, so 5 is in the sequence.
MAPLE
istriangular:=proc(n) local t1; t1:=floor(sqrt(2*n)); if n = t1*(t1+1)/2 then RETURN(true) else RETURN(false); fi; end;
M:=1000; for n from 1 to M do if istriangular(n*(n+1)*(2*n+1)/6) then lprint(n, n*(n+1)*(2*n+1)/6); fi; od: # N. J. A. Sloane
# second Maple program:
q:= n-> issqr(8*sum(j^2, j=1..n)+1):
select(q, [$1..100])[]; # Alois P. Heinz, Oct 10 2024
MATHEMATICA
Select[Range[90], IntegerQ[(Sqrt[(4/3) * (# + 3 * #^2 + 2 * #^3) + 1] - 1)/2] &] (* Harvey P. Dale, Sep 22 2014 *)
CROSSREFS
KEYWORD
fini,full,nonn,changed
AUTHOR
Jud McCranie, Mar 19 2000
EXTENSIONS
Edited by N. J. A. Sloane, May 25 2008
STATUS
approved