

A228968


Prime p such that p and p+2 are twin primes and p^2+p1 p^2+p+1 are also twin primes.


4



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
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,1


COMMENTS

Subsequence of A088483.


LINKS

Pierre CAMI, Table of n, a(n) for n = 1..10000


EXAMPLE

3 and 5 twin primes as 3*3+31=11 and 13, a(2)=3.
5 and 7 twin primes as 5*5+51=29 and 31, a(3)=5.


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 *)


PROG

PFGW & SCRIPTIFY
SCRIPT
DIM n, 0
DIM m
DIM k, 0
DIMS ta
OPENFILEOUT myf, a(n).txt
OPENFILEIN maf, twin.txt
LABEL loop1
SET n, n+1
IF n>2999999 THEN END
GETNEXT m, maf
SETS ta, %d\,; n
PRP m^2+m1, ta
IF ISPRP THEN GOTO a
GOTO loop1
LABEL a
PRP m^2+m+1, ta
IF ISPRP THEN GOTO b
GOTO loop1
LABEL b
WRITE myf, m
GOTO loop1
The file twin.txt has the first 3000000 of first of twin primes
(PFGW) ABC2 $a & $a+2 & $a^2+$a1 & $a^2+$a+1
a: 1 to 3000000
Charles R Greathouse IV, Sep 10 2013
(PARI) is(n)=isprime(n)&&isprime(n+2)&&isprime(n^2+n1)&&isprime(n^2+n+1) \\ Charles R Greathouse IV, Sep 10 2013
(Sage)
[x for x in primes_first_n(900) if x+2 in Primes() and x^2+x1 in Primes() and x^2+x+1 in Primes()] #Tom Edgar, Sep 10 2013


CROSSREFS

Cf. A088483.
Sequence in context: A176112 A215133 A146318 * A178545 A145912 A096058
Adjacent sequences: A228965 A228966 A228967 * A228969 A228970 A228971


KEYWORD

nonn


AUTHOR

Pierre CAMI, Sep 10 2013


STATUS

approved



