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!)
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
N. Fernandez, An order of primeness, F(p), 1999.
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:
end: # W. Edwin Clark, Aug 20 2018
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):
A318189_list.append(x[0])
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):
A318189_list.append(x[0])
break
if n < nmax-1:
for x in plist:
x.append(prime(x[-1])) # Chai Wah Wu, Aug 20 2018
CROSSREFS
Sequence in context: A124937 A279342 A169852 * A176914 A194010 A229609
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

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 31 05:41 EDT 2024. Contains 375550 sequences. (Running on oeis4.)