cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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

This page as a plain text file.
%I A064403 #23 Sep 25 2019 14:27:05
%S A064403 4,6,18,42,66,144,282,384,408,450,522,564,618,672,720,732,744,828,858,
%T A064403 1122,1308,1374,1560,1644,1698,1776,1848,1920,2022,2304,2412,2616,
%U A064403 2766,2778,2874,2958,2970,3036,3042,3240,3258,3354,3360,3432,3540,3594,3732
%N A064403 Numbers k such that prime(k) + k and prime(k) - k are both primes.
%C A064403 Starting with 6 all terms are == 0 (mod 6). - _Zak Seidov_, Jan 04 2013
%H A064403 Harry J. Smith, <a href="/A064403/b064403.txt">Table of n, a(n) for n = 1..1000</a>
%e A064403 4 is in the sequence because the fourth prime is 7 and both 7+4 and 7-4 are primes.
%t A064403 Select[ Range[ 4000 ], PrimeQ[ Prime[ # ] + # ] && PrimeQ[ Prime[ # ] - # ] & ]; Join[{4},Select[ Range[6, 4000,6 ], PrimeQ[Prime[ # ] + # ] && PrimeQ[ Prime[ # ] - # ] & ]] (* _Zak Seidov_, Jan 04 2013 *)
%t A064403 Select[Range[4000],AllTrue[Prime[#]+{#,-#},PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* _Harvey P. Dale_, Sep 25 2019 *)
%o A064403 (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 A064403 Cf. A143794 (corresponding primes).
%K A064403 nonn
%O A064403 1,1
%A A064403 _Robert G. Wilson v_, Sep 28 2001