OFFSET
1,1
COMMENTS
Number of terms of n digits: 4, 21, 15, 12, 7, 8, 2, 7, 2, 3, 5, 2, 2, 7, 2, 4, 2, 2, 4, 3, 1, 0, 3, 3, 0, ..., . - Robert G. Wilson v, May 29 2011
LINKS
Robert G. Wilson v, Table of n, a(n) for n = 1..262 (first 79 terms from Harry J. Smith) (shortened by N. J. A. Sloane, Jan 13 2019)
EXAMPLE
4111 is a member where a=4 and b = 1.
MAPLE
N:= 20:
A:= 2, 3, 5, 7:
for n from 2 to N do
for a from 1 to 9 do
for b in [1, 3, 7, 9] do
p:= a*10^(n-1) + b*(10^(n-1)-1)/9;
if isprime(p) then A:= A, p fi
od
od
od:
A; # Robert Israel, Oct 13 2014
MATHEMATICA
f[n_] := Select[ Union@ Flatten@ Table[ FromDigits@ Join[{a}, Table[b, {n - 1}]], {a, 9}, {b, {1, 3, 7, 9}}], PrimeQ]; Array[f, 5] // Flatten (* Robert G. Wilson v, May 29 2011 *)
PROG
(PARI) { n=r=0; default(primelimit, 1777777777); forprime (p=2, 1777777777, if (p>100, r=p\10; d=p-r*10; while (r>9 && r-r\10*10 == d, r\=10)); if (r<=9, write("b061022.txt", n++, " ", p)) ) } \\ Harry J. Smith, Jul 16 2009
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Amarnath Murthy, Jun 23 2001
EXTENSIONS
Corrected and extended by Dean Hickerson, Jul 10 2001
STATUS
approved