login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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. 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
EXAMPLE
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.
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+m-1, 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+$a-1 & $a^2+$a+1
a: 1 to 3000000
(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
(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
CROSSREFS
Cf. A088483.
Sequence in context: A176112 A215133 A146318 * A178545 A145912 A096058
KEYWORD
nonn
AUTHOR
Pierre CAMI, Sep 10 2013
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 28 16:58 EDT 2024. Contains 371254 sequences. (Running on oeis4.)