OFFSET
1,1
COMMENTS
Except a(1), all numbers are congruent to 1 mod 10 or 9 mod 10.
These are the primes in the sequence A237527.
EXAMPLE
5 = 3^2-3^1-1 (3 is prime) and 5^2-5-1 = 19 is prime. Since 5 is prime too, 5 is a member of this sequence.
MATHEMATICA
Select[Table[n^2-n-1, {n, Prime[Range[1000]]}], AllTrue[{#, #^2-#-1}, PrimeQ]&] (* Harvey P. Dale, Aug 14 2024 *)
PROG
(Python)
import sympy
from sympy import isprime
def poly2(x):
..if isprime(x):
....f = x**2-x-1
....if isprime(f**2-f-1):
......return True
..return False
x = 1
while x < 10**5:
..if poly2(x):
....if isprime(x**2-x-1):
......print(x**2-x-1)
..x += 1
(PARI)
s=[]; forprime(n=2, 40000, p=n^2-n-1; if(isprime(p) && isprime(p^2-p-1), s=concat(s, p))); s \\ Colin Barker, Feb 11 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
Derek Orr, Feb 10 2014
STATUS
approved