|
|
A318189
|
|
a(n) is the least prime q such that P_n(q) = prime^n(q) + prime^(n-1)(q) + ... + prime^2(q) + prime(q) + q + (1-(-1)^n)/2 is prime, or -1 if no such prime exists.
|
|
0
|
|
|
2, 5, 3, 13, 5, 3, 29, 3, 13, 13, 3, 5, 31, 7, 17
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,1
|
|
COMMENTS
|
Definition: prime^0(q) = q; prime^r(q) = prime(prime^(r-1)(q)); r >= 1. P_n(q) can be thought of as a "primeth polynomial" of degree n, the sum of terms of ascending orders of primeness, such that the result is always an odd (possibly prime) number. Because of the rapid growth of the primeth function only the first few terms of this sequence have been found so far.
Note: If q exists, a(n) > 2 for n >= 1 because P_n(2) is composite.
|
|
LINKS
|
|
|
EXAMPLE
|
For q = 2,3 P_1(q) = 6,9 respectively, but P_1(5) = 11 + 5 + 1 = 17; so a(1)=5.
For q = 2, P_2(2) = 5 + 3 + 2 = 10, but P_2(3) = 11 + 5 + 3 = 19, so a(2) = 3.
|
|
MAPLE
|
P:=proc(n, q)
add((ithprime@@j)(q), j=0..n)+(1-(-1)^n)/2;
end:
a:=proc(n)
local q, i;
for i from 1 do
q:=ithprime(i):
if isprime(P(n, q)) then return q; fi;
od:
|
|
PROG
|
(Python)
from __future__ import division
from sympy import isprime, prime, nextprime
A318189_list, nmax, plist = [], 8, [[2]]
for n in range(nmax):
r = (1-(-1)**n)//2
for x in plist:
if isprime(sum(x) + r):
break
else:
p = plist[-1][0]
while True:
p = nextprime(p)
x = [p]
for i in range(n):
x.append(prime(x[-1]))
plist.append(x)
if isprime(sum(x)+r):
break
if n < nmax-1:
for x in plist:
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,more
|
|
AUTHOR
|
|
|
EXTENSIONS
|
Terms a(0) and a(10) to a(14) were found by Edwin Clark, Hans Havermann, and Chai Wah Wu (Sequence Fans Mailing List, August, 2018).
|
|
STATUS
|
approved
|
|
|
|