OFFSET
1,1
COMMENTS
Suggested by Carlos Rivera's Puzzle 449, The Prime Puzzles & Problems Connection
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..10000
FORMULA
Compute the composite numbers beginning with 4. At 4 the composite index is zero, at 6 it is 1, at 8 it is 2, ... and at 12 it is 5, etc.
EXAMPLE
a(1) = 12 because 12+1 = 13, prime and the index of 12 is 5, so both the composite 12+1 and the index are prime.
PROG
(Python)
from sympy import compositepi, isprime
def ok(n):
return not isprime(n) and isprime(n+1) and isprime(compositepi(n)-1)
print([k for k in range(1549) if ok(k)]) # Michael S. Branicky, Dec 28 2021
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Enoch Haga, Jun 21 2008
EXTENSIONS
Edited by N. J. A. Sloane, Jun 21 2008
STATUS
approved