OFFSET
1,1
EXAMPLE
29 is prime and (29^3-29^2-29-1)^3 - (29^3-29^2-29-1)^2 - (29^3-29^2-29-1) - 1 = 13007166227989 is prime. Thus, 29 is a member of this sequence.
MATHEMATICA
f[n_] := n^3 - n^2 - n - 1; Select[ Prime@ Range[2, 740], PrimeQ@ f@ f@# &] (* Robert G. Wilson v, Mar 07 2014 *)
PROG
(Python)
import sympy
from sympy import isprime
def f(x):
..return x**3-x**2-x-1
{print(p) for p in range(10**4) if isprime(p) and isprime(f(f(p)))}
CROSSREFS
KEYWORD
nonn
AUTHOR
Derek Orr, Feb 23 2014
STATUS
approved