A368590 Numbers k such that all of k, k+1 and k+2 are the sums of consecutive squares.
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
Offset: 1
Keywords
Examples
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.
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
Programs
-
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
Comments