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”).

A089763
a(1) = 1, then the least n-digit prime such that the k-th digit from the Most significant side is prime if k is prime else is composite. The most significant digit is always a 1. 0 if no such prime exists.
0
1, 13, 127, 1229, 12203, 122029, 1220203, 12202429, 122024299, 1220202089, 12202020043, 122020200859, 1220202000307, 12202020002059, 122020200020309, 1220202000202069, 12202020002020867, 122020200020200639
OFFSET
1,2
COMMENTS
If n is composite then the least significant digit is mandatorily a 9. Conjecture: No term is zero.
EXAMPLE
a(8) = 12202429: first digit is 1, the 2nd, 3rd, 5th and 7th digits are 2 (a prime) and the rest are composite.
MAPLE
with(combinat, cartprod): ds:=proc(s) local j, l: l:=nops(s): RETURN(add(s[j]*10^(l-j), j=1..l)):end: p:=[2, 3, 5, 7]:c:=[0, 4, 8, 6, 9]: ctpr:=proc(n) local m, T: m:=1: T:=cartprod([[1], seq(piecewise(isprime(i), p, c), i=2..n)]): while not T[finished] do m:=ds(T[nextvalue]()): if isprime(m) then RETURN(m) fi od: end: 1, seq(ctpr(n), n=1..20); (C. Ronaldo)
CROSSREFS
Sequence in context: A139786 A016169 A125401 * A124298 A201040 A201550
KEYWORD
base,nonn
AUTHOR
Amarnath Murthy, Nov 22 2003
EXTENSIONS
More terms from C. Ronaldo (aga_new_ac(AT)hotmail.com), Dec 26 2004
STATUS
approved