OFFSET
1,1
COMMENTS
Same as A229190 but omitting the a(0) term.
Defined for all a by the normality of the Copeland-Erdős constant. - Aaron Weiner, Sep 19 2013
LINKS
Nathaniel Johnston, Table of n, a(n) for n = 1..5000
EXAMPLE
The first occurrence of "111" in the string is 5, so a(111)=5.
MAPLE
with(StringTools): s:="": for n from 1 to 300 do s:=cat(s, convert(ithprime(n), string)): od: seq(Search(convert(n, string), s), n=1..62); # Nathaniel Johnston, May 26 2011
MATHEMATICA
With[{prd=Flatten[IntegerDigits/@Prime[Range[1000]]], nn=10}, Flatten[ Table[ SequencePosition[ prd, IntegerDigits[ n], 1], {n, 70}], 1]][[All, 1]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, May 12 2019 *)
PROG
(Python)
from sympy import primerange
from itertools import count, takewhile
def afind(plimit):
s = "".join(str(p) for p in primerange(1, plimit+1))
return [1+s.find(str(n)) for n in takewhile(lambda i: str(i) in s, count(1))]
print(afind(10**4)) # Michael S. Branicky, May 01 2021
CROSSREFS
KEYWORD
easy,base,nonn
AUTHOR
Rémy Sigrist, Sep 20 2009
STATUS
approved