A228968 Prime p such that p and p+2 are twin primes and p^2+p-1 p^2+p+1 are also twin primes.
3, 5, 41, 59, 101, 2729, 3251, 9719, 11549, 12251, 19211, 28619, 41201, 47711, 49391, 55439, 58229, 61979, 63029, 63311, 79631, 81371, 85331, 103391, 122039, 135719, 153509, 157349, 164249, 167441, 178601, 188861, 197711, 208001, 209819, 216779, 219311, 226451
Offset: 1
Keywords
Examples
3 and 5 twin primes as 3*3+3-1=11 and 13, a(2)=3. 5 and 7 twin primes as 5*5+5-1=29 and 31, a(3)=5.
Links
- Pierre CAMI, Table of n, a(n) for n = 1..10000
Crossrefs
Cf. A088483.
Programs
-
Mathematica
Select[Transpose[Select[Partition[Prime[Range[21000]],2,1],#[[2]]-#[[1]] == 2&]][[1]],AllTrue[ #^2+#+{1,-1},PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Nov 10 2014 *)
-
PARI
is(n)=isprime(n)&&isprime(n+2)&&isprime(n^2+n-1)&&isprime(n^2+n+1) \\ Charles R Greathouse IV, Sep 10 2013
-
PFGW
ABC2 $a & $a+2 & $a^2+$a-1 & $a^2+$a+1 a: 1 to 3000000 Charles R Greathouse IV, Sep 10 2013
-
Sage
[x for x in primes_first_n(900) if x+2 in Primes() and x^2+x-1 in Primes() and x^2+x+1 in Primes()] #Tom Edgar, Sep 10 2013
Comments