

A368590


Numbers k such that all of k, k+1 and k+2 are the sums of consecutive squares.


1



728, 1013, 2813, 3309, 4323, 4899, 12438, 21259, 23113, 31394, 35719, 37812, 38023, 111894, 143449, 194053, 418613, 418614, 487368, 535309, 2232593, 2452644, 2490669, 9226854, 17367998, 19637644, 20341453, 28553671, 33406839, 174398434, 468936719, 1468970139, 2136314464
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,1


COMMENTS

418613 is the smallest k such that k through k + 3 are the sums of consecutive squares.
a(30)a(33) were calculated using the bfile at A368570.


LINKS



EXAMPLE

728 is in the sequence via 728 = 7^2 + 8^2 + 9^2 + 10^2 + 11^2 + 12^2 + 13^2, 729 = 27^2 and 730 = 10^2 + 11^2 + 12^2 + 13^2 + 14^2.


PROG

(PARI) \\ See PARI program
(Python)
import heapq
from itertools import islice
def agen(): # generator of terms
m = 1; h = [(m, 1, 1)]; nextcount = 2
v1 = v2 = 1
while True:
(v, s, l) = heapq.heappop(h)
if v != v1:
if v2 + 2 == v1 + 1 == v: yield v2
v2, v1 = v1, v
if v >= m:
m += nextcount*nextcount
heapq.heappush(h, (m, 1, nextcount))
nextcount += 1
v = s*s; s += 1; l += 1; v += l*l
heapq.heappush(h, (v, s, l))


CROSSREFS



KEYWORD

nonn


AUTHOR



STATUS

approved



