|
|
A105411
|
|
Numbers p(n) such that both p(n)+2 and p(n+4)-2 are prime numbers, where p(n) is the n-th prime number (A000040(n)).
|
|
0
|
|
|
3, 17, 29, 59, 227, 269, 617, 1031, 1277, 1289, 1301, 1607, 1667, 1697, 2087, 2129, 2309, 2711, 2789, 3257, 3527, 3539, 3557, 3917, 4019, 4241, 4517, 4637, 4787, 5477, 5501, 5639, 6551, 7307, 8819, 8837, 8999, 9011, 10037, 10067, 10271, 10499, 12041
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
prime(7)=17, and both prime(7)+2=19 and prime(7+4)-2=29 are prime, so 17 is in the sequence.
|
|
LINKS
|
|
|
MATHEMATICA
|
For[n = 1, n < 500, n++, If[PrimeQ[Prime[n] + 2], If[PrimeQ[Prime[n + 4] - 2], Print[Prime[n]]]]] (* Stefan Steinerberger, Feb 07 2006 *)
Select[Partition[Prime[Range[1500]], 5, 1], AllTrue[{#[[1]]+2, #[[5]]-2}, PrimeQ]&][[All, 1]] (* Harvey P. Dale, Oct 28 2022 *)
|
|
PROG
|
(PARI) pnpk(n, m=4, k=2) = { local(x, v1, v2); for(x=1, n, v1 = prime(x)+ k; v2 = prime(x+m)-k; if(isprime(v1)&isprime(v2), print1(prime(x), ", ") ) ) ; } \\ corrected by Michel Marcus, Sep 14 2015
(Magma) [NthPrime(n): n in [1..1500] | IsPrime(NthPrime(n)+2) and IsPrime(NthPrime(n+4)-2)]; // Vincenzo Librandi, Sep 14 2015
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|