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!)
A356048 a(n) is the least prime p such that p^2 - 2*prime(n)^2 is prime. 3
5, 5, 11, 11, 17, 19, 29, 31, 37, 43, 53, 53, 61, 61, 67, 101, 97, 89, 97, 107, 109, 131, 127, 131, 139, 151, 149, 163, 157, 163, 181, 193, 199, 197, 227, 223, 223, 233, 257, 263, 263, 271, 271, 281, 293, 283, 317, 317, 347, 331, 331, 349, 349, 359, 367, 379, 389, 409, 431, 401, 409, 419, 449 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
FORMULA
a(n)^2 = 2*A001248(n) + A356060(n).
EXAMPLE
a(3) = 11 because 11 is prime, the third prime is 5, 11^2-2*5^2 = 71 is prime, and 11 is the least prime that works.
MAPLE
f:= proc(n) local q;
q:= floor(sqrt(2)*n);
do
q:= nextprime(q);
if isprime(q^2-2*n^2) then return q fi;
od
end proc:
map(f, [seq(ithprime(i), i=1..100)]);
MATHEMATICA
a[n_] := Module[{m = 2*Prime[n]^2, p}, p = Floor[Sqrt[m]]; While[p = NextPrime[p]; !PrimeQ[p^2 - m]]; p]; Array[a, 100] (* Amiram Eldar, Jul 24 2022 *)
PROG
(Python)
from sympy import isprime, nextprime, prime
def a(n):
p = pn = prime(n)
while not isprime(p*p - 2*pn*pn): p = nextprime(p)
return p
print([a(n) for n in range(1, 64)]) # Michael S. Branicky, Jul 24 2022
CROSSREFS
Sequence in context: A239355 A218121 A168300 * A101203 A141244 A121849
KEYWORD
nonn
AUTHOR
J. M. Bergot and Robert Israel, Jul 24 2022
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 August 28 05:00 EDT 2024. Contains 375477 sequences. (Running on oeis4.)