A236304 Primes p such that p+12, p+1234 and p+123456 are also prime.
127, 907, 3037, 3457, 5737, 7057, 11047, 15427, 15667, 21517, 24697, 30307, 38287, 38317, 39607, 40177, 46477, 47797, 48787, 51157, 52177, 57667, 65587, 70627, 70867, 71887, 72997, 74857, 75277, 80317, 99817, 100447, 103657, 106747, 128437, 130087, 132157
Offset: 1
Keywords
Examples
a(1) = 127 is a prime: 127+12 = 139, 127+1234 = 1361 and 127+123456 = 123583 are also prime. a(2) = 907 is a prime: 907+12 = 919, 907+1234 = 2141 and 907+123456 = 124363 are also prime.
Links
- K. D. Bajpai, Table of n, a(n) for n = 1..5077
Programs
-
Maple
KD:= proc() local a,b,d,e; a:= ithprime(n); b:=a+12;d:=a+1234;e:=a+123456; if isprime(b)and isprime(d)and isprime(e) then return (a) :fi; end: seq(KD(), n=1..15000);
-
Mathematica
KD={}; Do[p=Prime[n]; If[PrimeQ[p+12]&&PrimeQ[p+1234]&&PrimeQ[p+123456], AppendTo[KD,p]], {n,15000}];KD c=0; p=Prime[n]; Do[If[PrimeQ[p+12]&&PrimeQ[p+1234]&&PrimeQ[p+123456], c=c+1; Print[c," ",p]],{n,1,5*10^6}];(*b-file*)
-
PARI
s=[]; forprime(p=2, 140000, if(isprime(p+12) && isprime(p+1234) && isprime(p+123456), s=concat(s, p))); s \\ Colin Barker, Apr 22 2014
Comments