Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #27 Aug 31 2021 11:22:43
%S 35,87,471,155,38,24,88,28,4,35,30,7,32,3,25,35,15,7,200,0,15,37,405,
%T 115,11,68,585,309,115,0,42,144,27,17,7,247,292,94,132,0,46,56,112,67,
%U 80,411,319,80,89,0,16,46,180,330,44,193,213,99,326,0,6,290,172,98,540
%N A tag automaton (see the Comments section).
%C Start with any positive integer K. At each step, add the first two digits and append the sum to the end, then remove the first digit to obtain the new state. Iterate until K reappears, and then a(K) is the number of steps until K reappears. (Definition corrected by Allan Wechsler.)
%C If K never reappears, a(K) = 0.
%C As we need at least two digits to start the procedure, we decide that a(1) to a(9) are to be written as 01, 02, 03, 04, 05, 06, 07, 08 and 09.
%C Conjecture: a(K) = 0 if K contains any of the substrings '00', '20', '30', '40', '50', '60', '70', '80', or '90', or the substrings '132', '232', '356', '358', '532', '534', '632', '634', '635', '656', '732', '734', '832', '834', '835', '932', '934', '935', or '958'. - _Hans Havermann_, Aug 21 2021
%H Eric Angelini et al., <a href="https://mailman.xmission.com/hyperkitty/list/math-fun@mailman.xmission.com/thread/IIESOWF246WLCEL7JBXQS6YGUGMUOJTC/">When-is-my-pattern-coming-back</a>, Math Fun mailing list, August 2021.
%H Hans Havermann, <a href="http://chesswanks.com/num/EA'sPatternRepeat.txt">Number of steps for 10 to 1000</a>.
%e 09 is successively transformed as follows:
%e 09
%e .99
%e ..918
%e ...1810
%e ....8109
%e and 09 reappears after 4 steps, so a(9) = 4.
%e 10 will be successively transformed as follows:
%e 10
%e .01
%e ..11
%e ...12
%e ....23
%e .....35
%e ......58
%e .......813
%e ........139
%e .........394
%e ..........9412
%e ...........41213
%e ............12135 etc.
%e The full string (without erasures) after 35 steps is:
%e 10112358139412135334886712161413833775541111610, and "10" has reappeared, ending the procedure. The next digit is 1, so starting at "01" (line 2) would also take 35 steps for "01" to reappear. Hence a(1) = 35.
%e a(735) = 3213292, where the full string contains 4143987 digits.
%t g[n_]:=Join[Rest@n,IntegerDigits@Total[n[[;;2]]]];Table[k=If[Mod[k,10]==0,If[Mod[k,100]==10,k,0],k];
%t If[k==0,0,d=g@If[k<10,b=""<>{"0",ToString@k};Join[{0},{k}],b=ToString@k;IntegerDigits@k];
%t Length@NestWhileList[g@#&,d,!StringContainsQ[ToString@FromDigits@#,
%t b]&]],{k,131}] (* _Giorgos Kalogeropoulos_, Aug 19 2021 *)
%o (Python)
%o def delta(s): return str(int(s[0]) + int(s[1]))
%o def a(n):
%o if n%10 == 0 and n%100 != 10: return 0
%o s = "0"*(n < 10) + str(n)
%o i, target, nexts = 1, s[:], delta(s[:2])
%o s = s[1:] + nexts
%o while target not in s:
%o nexts = delta(s[:2])
%o s = s[1:] + nexts
%o i += 1
%o return i
%o print([a(n) for n in range(1, 132)]) # _Michael S. Branicky_, Aug 19 2021
%Y Cf. A339092.
%K base,nonn
%O 1,1
%A _Eric Angelini_ and _Hans Havermann_, Aug 19 2021
%E Edited by _N. J. A. Sloane_, Aug 31 2021