login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A368590 Numbers k such that all of k, k+1 and k+2 are the sums of consecutive squares. 1

%I #43 Feb 02 2024 15:18:52

%S 728,1013,2813,3309,4323,4899,12438,21259,23113,31394,35719,37812,

%T 38023,111894,143449,194053,418613,418614,487368,535309,2232593,

%U 2452644,2490669,9226854,17367998,19637644,20341453,28553671,33406839,174398434,468936719,1468970139,2136314464

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

%C 418613 is the smallest k such that k through k + 3 are the sums of consecutive squares.

%C After an idea by _Allan C. Wechsler_.

%C a(30)-a(33) were calculated using the b-file at A368570.

%H Michael S. Branicky, <a href="/A368590/b368590.txt">Table of n, a(n) for n = 1..94</a> (terms 1..74 from Frank A. Stevenson)

%H David A. Corneth, <a href="/A368590/a368590.gp.txt">PARI program</a>

%e 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.

%o (PARI) \\ See PARI program

%o (Python)

%o import heapq

%o from itertools import islice

%o def agen(): # generator of terms

%o m = 1; h = [(m, 1, 1)]; nextcount = 2

%o v1 = v2 = -1

%o while True:

%o (v, s, l) = heapq.heappop(h)

%o if v != v1:

%o if v2 + 2 == v1 + 1 == v: yield v2

%o v2, v1 = v1, v

%o if v >= m:

%o m += nextcount*nextcount

%o heapq.heappush(h, (m, 1, nextcount))

%o nextcount += 1

%o v -= s*s; s += 1; l += 1; v += l*l

%o heapq.heappush(h, (v, s, l))

%o print(list(islice(agen(), 33))) # _Michael S. Branicky_, Jan 01 2024

%Y Subsequence of A034705 and of A368570.

%K nonn

%O 1,1

%A _David A. Corneth_, Dec 31 2023

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 19 12:29 EDT 2024. Contains 374394 sequences. (Running on oeis4.)