%I #25 Sep 19 2023 06:36:17
%S 1,15,37,59,81,103,125,147,169,214,235,271,307,533,836,1139,1442,1745,
%T 2048,2651,541,708,978,1308,1608,1908,2208,2508,2808,4115,2684,3020,
%U 3424,3428,4232,4331,4375,4419,4463,6652,3229,4595,4639,4679,4719,4767
%N a(n) is the starting position of the n-th occurrence of n in the string 123456789101112131415161718192021... .
%H Project Euler, <a href="https://projecteuler.net/problem=305">Problem 305: Reflexive Position</a>
%o (Python)
%o def a(n):
%o # a(n) is the starting position of the n-th occurrence of n in
%o # the string 123456789101112131415161718192021 .
%o full='~'+''.join(map(str,range(1,10000)))
%o def place(n,str_n,offset):
%o p=full[offset:].find(str_n)+offset
%o return p if n==1 else place(n-1,str_n,p+1)
%o return place(n,str(n),0)
%o # prints the first fifty terms
%o print(', '.join(str(a(i)) for i in range(1,51)))
%Y Cf. A033307, A031297 (first occurrence).
%K nonn,base
%O 1,2
%A Jon Palin (jon.palin(AT)gmail.com), Oct 15 2010