login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A243411
Least prime p such that p*10^n-1, p*10^n-3, p*10^n-7 and p*10^n-9 are all prime.
0
2, 2, 10193, 24851, 20549, 719, 22133, 230471, 46679, 432449, 114689, 227603, 305297, 61463, 1866467, 866309, 1189403, 362081, 2615783, 493433, 966353, 4154363, 6562931, 9096203, 3701627, 3128813, 20983727, 303593, 24437537, 1068491
OFFSET
1,1
MATHEMATICA
lpp[n_]:=Module[{p=2, c=10^n}, While[!AllTrue[p*c-{1, 3, 7, 9}, PrimeQ], p= NextPrime[ p]]; p]; Array[lpp, 30] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Jun 12 2016 *)
PROG
(Python)
import sympy
from sympy import isprime
from sympy import prime
def a(n):
..for k in range(1, 10**8):
....if isprime(prime(k)*10**n-1) and isprime(prime(k)*10**n-3) and isprime(prime(k)*10**n-7) and isprime(prime(k)*10**n-9):
......return prime(k)
n = 1
while n < 100:
..print(a(n), end=', ')
..n+=1
(PARI) a(n)=for(k=1, 10^8, if(ispseudoprime(prime(k)*10^n-1) && ispseudoprime(prime(k)*10^n-3) && ispseudoprime(prime(k)*10^n-7) && ispseudoprime(prime(k)*10^n-9), return(prime(k))))
n=1; while(n<100, print1(a(n), ", "); n++)
CROSSREFS
Sequence in context: A260753 A079237 A262060 * A013510 A013504 A230807
KEYWORD
nonn
AUTHOR
Derek Orr, Jun 04 2014
STATUS
approved