|
|
A359396
|
|
a(n) is the least k such that k^j+2 is prime for j = 1 to n but not n+1.
|
|
0
|
|
|
|
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.
|
|
LINKS
|
|
|
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
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,more
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|