OFFSET
1,1
COMMENTS
a(67)>10^5000. - Robert G. Wilson v, Mar 01 2008
LINKS
Robert G. Wilson v, Table of n, a(n) for n=1..66
EXAMPLE
Examples from N. J. A. Sloane, Feb 24 2021: (Start)
S = 1234567891011121314151617181920212...
The 10th digit is a 1, and the first prime in S that starts with that digit is 101.
The 11th digit is 0, so we skip it.
The 12th digit is 1, and the first prime in S that starts with that digit is 11.
The 13th digit is another 1, and the first prime in S that starts with that digit is another 11.
The 14th digit is another 1, and the first prime in S that starts with that digit is 1213.
And so on. (End)
MATHEMATICA
a[n_] := Block[{m = 0, d = n, i = 1, l, p}, While[m <= d, l = m; m = 9 i*10^(i - 1) + l; i++ ]; i--; p = Mod[d - l, i]; q = Floor[(d - l)/i] + 10^(i - 1); If[p != 0, IntegerDigits[q][[p]], Mod[q - 1, 10]]]; pp[j_, k_] := FromDigits[ Table[ a@i, {i, j, k}]]; f[n_] := Block[{m = n, p}, If[a@n != 0, (While[p = pp[n, m]; ! PrimeQ@ p, m++ ]; p), ]]; Array[f, 29] (* Robert G. Wilson v, Mar 01 2008 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Marcelo Iglesias (markelo(AT)gmail.com), Feb 26 2008
EXTENSIONS
More terms from Robert G. Wilson v, Mar 01 2008
STATUS
approved