OFFSET
1,1
COMMENTS
Note that f(f(f(n))) = (-1 + 4*n - 3*n^3 + n^4)*(1 + n - 3*n^2 - n^3 + n^4) is always composite. - Zak Seidov, Nov 10 2014
FORMULA
EXAMPLE
3 is prime and (3^2-3-1)^2-(3^2-3-1)-1 = 19 is also prime. So, 3 is a member of this sequence.
PROG
(Python)
import sympy
from sympy import isprime
def f(x):
return x**2-x-1
{p for p in range(10**4) if isprime(p) and isprime(f(f(p)))}
(Sage)
f = lambda x: x^2-x-1
[p for p in primes(1452) if is_prime(f(f(p)))] # Peter Luschny, Mar 02 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
Derek Orr, Feb 23 2014
STATUS
approved