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!)
A064403 Numbers k such that prime(k) + k and prime(k) - k are both primes. 10

%I #23 Sep 25 2019 14:27:05

%S 4,6,18,42,66,144,282,384,408,450,522,564,618,672,720,732,744,828,858,

%T 1122,1308,1374,1560,1644,1698,1776,1848,1920,2022,2304,2412,2616,

%U 2766,2778,2874,2958,2970,3036,3042,3240,3258,3354,3360,3432,3540,3594,3732

%N Numbers k such that prime(k) + k and prime(k) - k are both primes.

%C Starting with 6 all terms are == 0 (mod 6). - _Zak Seidov_, Jan 04 2013

%H Harry J. Smith, <a href="/A064403/b064403.txt">Table of n, a(n) for n = 1..1000</a>

%e 4 is in the sequence because the fourth prime is 7 and both 7+4 and 7-4 are primes.

%t Select[ Range[ 4000 ], PrimeQ[ Prime[ # ] + # ] && PrimeQ[ Prime[ # ] - # ] & ]; Join[{4},Select[ Range[6, 4000,6 ], PrimeQ[Prime[ # ] + # ] && PrimeQ[ Prime[ # ] - # ] & ]] (* _Zak Seidov_, Jan 04 2013 *)

%t Select[Range[4000],AllTrue[Prime[#]+{#,-#},PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* _Harvey P. Dale_, Sep 25 2019 *)

%o (PARI) { n=0; default(primelimit, 1800000); for (m=1, 10^9, if (isprime(prime(m) + m) && isprime(prime(m) - m), write("b064403.txt", n++, " ", m); if (n==1000, break)) ) } \\ _Harry J. Smith_, Sep 13 2009

%Y Cf. A143794 (corresponding primes).

%K nonn

%O 1,1

%A _Robert G. Wilson v_, Sep 28 2001

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 May 10 17:06 EDT 2024. Contains 372388 sequences. (Running on oeis4.)