The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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!)
A080478 a(n) = smallest k>a(n-1) such that k^2+a(n-1)^2 is prime, starting with a(1)=1. Square roots of A062067(n). 5
1, 2, 3, 8, 13, 20, 23, 30, 31, 44, 49, 74, 79, 80, 89, 96, 101, 104, 105, 116, 119, 124, 131, 134, 139, 140, 149, 150, 157, 158, 165, 172, 173, 178, 183, 202, 203, 230, 231, 250, 257, 260, 261, 274, 289, 290, 291, 296, 311, 334, 335, 342, 343, 360, 367, 372 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..10000 (first 2000 terms from Zak Seidov).
MAPLE
A[1]:= 1:
for n from 2 to 100 do
for k from A[n-1]+1 while not isprime(k^2+A[n-1]^2) do od:
A[n]:= k
od:
seq(A[n], n=1..100); # Robert Israel, Sep 01 2014
MATHEMATICA
nxt[n_]:=Module[{n2=n^2, k=n+1}, While[!PrimeQ[k^2+n2], k++]; k]; NestList[nxt, 1, 60] (* Harvey P. Dale, Jun 24 2012 *)
a=1; sq={1}; Do[a2=a^2; b=a+1; While[!PrimeQ[a2+b^2], b=b+2]; AppendTo[sq, b]; a=b, {100}]; sq (* Zak Seidov, Feb 21 2014 *)
PROG
(PARI) p=1; print1(p", "); for(n=2, 1000, if(isprime(p+n^2), print1(n", "); p=n^2))
(Haskell)
a080478 n = a080478_list !! (n-1)
a080478_list = 1 : f 1 [2..] where
f x (y:ys) | a010051 (x*x + y*y) == 1 = y : (f y ys)
| otherwise = f x ys
-- Reinhard Zumkeller, Apr 28 2011
(Python)
from sympy import isprime
A080478, a = [1], 1
for _ in range(1, 10000):
....a += 1
....b = 2*a*(a-1) + 1
....while not isprime(b):
........b += 4*(a+1)
........a += 2
....A080478.append(a) # Chai Wah Wu, Sep 01 2014
CROSSREFS
Sequence in context: A217330 A358207 A236169 * A002053 A102315 A142880
KEYWORD
nonn
AUTHOR
Ralf Stephan, Mar 22 2003
EXTENSIONS
PARI program corrected by Zak Seidov, Apr 14 2008
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 May 17 04:32 EDT 2024. Contains 372579 sequences. (Running on oeis4.)