Digit echo forbidden

 

 

1) If the n-th digit of S is “d” (d chosen from 0,1,2,3,...9) then the (n+d+1)th digit of S cannot be “d”.

2) Start S with a(1)=1

3) Always extend S with the smallest available integer not yet present in S and not leading to a contradiction.

 

no “d” -->                                                                        2                      

no “d” -->                    0   2  1  2 1     1   1     2                   1   5        2              

no “d” -->   1   2   3   4  5 16 07 18  9 2  03 3  22 1   4 13  2 15 42 1  62 6   7 1   2 87  1 39        

     S = 1,2,3,4,5,6,7,8,9,10,20,11,22,13,30,12,21,14,23,15,24,16,26,17,25,18,27,19,28,29,31,32,40,...    

 

S is obviously finite (the term 9876543210 blocks any extension, for example); what is the last term of S?

 

Best,

É.