OFFSET
1,1
LINKS
Harry J. Smith, Table of n, a(n) for n = 1..100
MATHEMATICA
Do[a = Table[7, {n} ]; k = 0; While[ b = FromDigits[ Join[ IntegerDigits[k], a]]; Mod[k, 10] == 7 || !PrimeQ[b], k++ ]; Print[b], {n, 1, 17} ]
k7[n_]:=Module[{c=FromDigits[PadRight[{}, n, 7]], k=0}, While[Nand[PrimeQ[k*10^n + c], Mod[k, 10] != 7], k++]; k*10^n+c]; Array[k7, 20] (* Harvey P. Dale, Jan 29 2013 *)
PROG
(PARI) a(n)={ my(t=10^n, b=7*(t-1)/9, d=0); while (!isprime(b + t*d), d++; if(d%10==7, d++)); b + t*d } \\ Harry J. Smith, Oct 23 2009
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Robert G. Wilson v, Nov 28 2001
STATUS
approved