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!)
A360061 Lexicographically earliest increasing sequence such that a(1) = 2 and for n >= 2, a(1)^2 + a(2)^2 + ... + a(n)^2 is a prime. 1
2, 3, 4, 12, 48, 54, 66, 138, 144, 162, 168, 180, 198, 234, 252, 264, 330, 360, 366, 372, 402, 420, 444, 462, 480, 534, 546, 552, 564, 576, 600, 630, 642, 678, 702, 744, 756, 846, 852, 858, 882, 966, 1008, 1206, 1242, 1254, 1266, 1272, 1296, 1302, 1338, 1650 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
EXAMPLE
For n >= 2, partial sums of squares are (showing primality): 2^2 + 3^2 = 13; 13 + 4^2 = 29; 29 + 12^2 = 173; 173 + 48^2 = 2477; ...
MAPLE
s:= proc(n) option remember; `if`(n<1, 0, a(n)^2+s(n-1)) end:
a:= proc(n) option remember; local k, m;
k:= s(n-1); for m from 1+a(n-1)
while not isprime(k+m^2) do od; m
end: a(1):=2:
seq(a(n), n=1..52); # Alois P. Heinz, Jan 26 2023
PROG
(Haskell)
import Math.NumberTheory.Primes.Testing (isPrime)
a360061_list = 2 : 3 : recurse 4 13 where
recurse n p
| isPrime(n^2 + p) = n : recurse (n+1) (n^2 + p)
| otherwise = recurse (n+1) p
-- Peter Kagey, Jan 25 2023
CROSSREFS
Sequence in context: A053350 A165302 A276530 * A251411 A117342 A328210
KEYWORD
easy,nonn
AUTHOR
Win Wang, Jan 23 2023
STATUS
approved

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 April 19 19:02 EDT 2024. Contains 371798 sequences. (Running on oeis4.)