login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A347140 A tag automaton (see the Comments section). 0
35, 87, 471, 155, 38, 24, 88, 28, 4, 35, 30, 7, 32, 3, 25, 35, 15, 7, 200, 0, 15, 37, 405, 115, 11, 68, 585, 309, 115, 0, 42, 144, 27, 17, 7, 247, 292, 94, 132, 0, 46, 56, 112, 67, 80, 411, 319, 80, 89, 0, 16, 46, 180, 330, 44, 193, 213, 99, 326, 0, 6, 290, 172, 98, 540 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
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.)
If K never reappears, a(K) = 0.
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.
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
LINKS
Eric Angelini et al., When-is-my-pattern-coming-back, Math Fun mailing list, August 2021.
EXAMPLE
09 is successively transformed as follows:
09
.99
..918
...1810
....8109
and 09 reappears after 4 steps, so a(9) = 4.
10 will be successively transformed as follows:
10
.01
..11
...12
....23
.....35
......58
.......813
........139
.........394
..........9412
...........41213
............12135 etc.
The full string (without erasures) after 35 steps is:
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.
a(735) = 3213292, where the full string contains 4143987 digits.
MATHEMATICA
g[n_]:=Join[Rest@n, IntegerDigits@Total[n[[;; 2]]]]; Table[k=If[Mod[k, 10]==0, If[Mod[k, 100]==10, k, 0], k];
If[k==0, 0, d=g@If[k<10, b=""<>{"0", ToString@k}; Join[{0}, {k}], b=ToString@k; IntegerDigits@k];
Length@NestWhileList[g@#&, d, !StringContainsQ[ToString@FromDigits@#,
b]&]], {k, 131}] (* Giorgos Kalogeropoulos, Aug 19 2021 *)
PROG
(Python)
def delta(s): return str(int(s[0]) + int(s[1]))
def a(n):
if n%10 == 0 and n%100 != 10: return 0
s = "0"*(n < 10) + str(n)
i, target, nexts = 1, s[:], delta(s[:2])
s = s[1:] + nexts
while target not in s:
nexts = delta(s[:2])
s = s[1:] + nexts
i += 1
return i
print([a(n) for n in range(1, 132)]) # Michael S. Branicky, Aug 19 2021
CROSSREFS
Cf. A339092.
Sequence in context: A115393 A086337 A118631 * A220041 A182755 A300554
KEYWORD
base,nonn
AUTHOR
Eric Angelini and Hans Havermann, Aug 19 2021
EXTENSIONS
Edited by N. J. A. Sloane, Aug 31 2021
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 18 03:55 EDT 2024. Contains 374377 sequences. (Running on oeis4.)