[go: up one dir, main page]

login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A359396
a(n) is the least k such that k^j+2 is prime for j = 1 to n but not n+1.
0
5, 9, 105, 3, 909, 4995825, 28212939
OFFSET
1,1
COMMENTS
All terms are odd, and all except a(1) = 5 are divisible by 3.
The generalized Bunyakovsky conjecture implies that a(n) exists for all n.
a(8) > 10^10.
a(8) > 10^11. - Lucas A. Brown, Jan 11 2023
EXAMPLE
a(4) = 3 because 3^1 + 2 = 5, 3^2 + 2 = 11, and 3^3 + 2 = 29 and 3^4 + 2 = 83 are prime but 3^5 + 2 = 245 is not.
MAPLE
f:= proc(n) local j;
for j from 1 do
if not isprime(n^j+2) then return j-1 fi
od
end proc:
V:= Vector(7): V[1]:= 5: count:= 1:
for k from 3 by 6 while count < 7 do
v:= f(k);
if v > 0 and V[v] = 0 then V[v]:= k; count:= count+1 fi
od:
convert(V, list);
PROG
(Python)
from sympy import isprime
from itertools import count, islice
def f(k):
j = 1
while isprime(k**j + 2): j += 1
return j-1
def agen():
adict, n = dict(), 1
for k in count(2):
v = f(k)
if v not in adict: adict[v] = k
while n in adict: yield adict[n]; n += 1
print(list(islice(agen(), 5))) # Michael S. Branicky, Jan 09 2023
CROSSREFS
Cf. A087576.
Sequence in context: A279707 A329002 A280642 * A222583 A222374 A097397
KEYWORD
nonn,more
AUTHOR
Robert Israel, Dec 29 2022
STATUS
approved