OFFSET
0,1
COMMENTS
Consider the infinite string
01234567891011121314151617181920... (cf. A033307)
formed by the concatenation of all decimal digits of all nonnegative numbers. From the position of the first digit of the first occurrence of the number n find the number of digits one has to move forward to get to the start of the second occurrence of n. This is a(n).
LINKS
Scott R. Shannon, Image of the first 100000 terms.
EXAMPLE
The infinite string corresponding to the concatenation of all decimal digits >=0 starts "012345678910111213141516171819202122232425....".
a(0) = 11 because '0' appears at positions 1 and 12.
a(1) = 9 because '1' appears at positions 2 and 11.
a(10) = 180 because '10' appears starting at positions 11 and 191.
a(11) = 1 because '11' appears starting at positions 13 and 14.
PROG
(Python)
from itertools import count
def A337227(n):
s1 = tuple(int(d) for d in str(n))
s2 = s1
for i, s in enumerate(int(d) for k in count(n+1) for d in str(k)):
s2 = s2[1:]+(s, )
if s2 == s1:
return i+1 # Chai Wah Wu, Feb 18 2022
CROSSREFS
KEYWORD
AUTHOR
Scott R. Shannon and N. J. A. Sloane, Aug 19 2020
STATUS
approved