OFFSET
1,1
COMMENTS
418613 is the smallest k such that k through k + 3 are the sums of consecutive squares.
After an idea by Allan C. Wechsler.
a(30)-a(33) were calculated using the b-file at A368570.
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..94 (terms 1..74 from Frank A. Stevenson)
David A. Corneth, PARI program
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))
print(list(islice(agen(), 33))) # Michael S. Branicky, Jan 01 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
David A. Corneth, Dec 31 2023
STATUS
approved