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!)
A356330 a(n) is the least prime p such that p^n-2 is prime. 1
5, 2, 19, 3, 3, 3, 7, 7, 3, 53, 1171, 7, 19, 5, 7, 73, 31, 61, 19, 19, 31, 3, 19, 17, 349, 5, 499, 7, 1021, 17, 7, 491, 823, 463, 1171, 59, 3, 19, 199, 179, 3, 29, 1609, 463, 373, 379, 2539, 439, 349, 5, 1051, 241, 439, 467, 61, 89, 433, 563, 139, 499, 139, 607, 409, 1607, 433, 1423, 2719, 7933, 31 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
a(n) = 3 for n > 2 in A014224.
LINKS
EXAMPLE
a(3) = 19 because 19 and 19^3 - 2 = 6857 are prime and no prime < 19 works.
MAPLE
f:= proc(n) local p;
p:= 1;
do
p:= nextprime(p);
if isprime(p^n-2) then return p fi
od
end proc:
map(f, [$1..100]);
MATHEMATICA
a[n_] := Module[{p = 2}, While[!PrimeQ[p^n - 2], p = NextPrime[p]]; p]; Array[a, 100] (* Amiram Eldar, Aug 04 2022 *)
PROG
(Python)
from sympy import isprime, nextprime
def a(n):
p = 2
while not isprime(p**n - 2): p = nextprime(p)
return p
print([a(n) for n in range(1, 70)]) # Michael S. Branicky, Aug 04 2022
CROSSREFS
Cf. A014224.
Sequence in context: A286154 A367288 A304635 * A306198 A327316 A206582
KEYWORD
nonn
AUTHOR
Robert Israel, Aug 03 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 June 11 19:50 EDT 2024. Contains 373317 sequences. (Running on oeis4.)