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 #30 Feb 05 2024 10:49:41
%S 0,1,12,24,48,96,192,384,864,576,192,1728,384,1152,3072,1536,6912,
%T 5184,3456,2880,4032,3456,192,1728,384,1728,12096,3456,13824,1152,
%U 3072,1536,1152,1152,5760,2304,9216,0,21504,6144,1536,7680,4608,9216,41472,62208,6912,13824,25920,5184,41472,20736,10368,13824
%N S is a "boomerang sequence": multiply each digit d of S by the number to which d belongs: the sequence S remains identical to itself if we follow each multiplication with a comma.
%C S is the lexicographycally earliest nontrivial sequence of nonnegative integers with this property (if we try for a(3) the integers 1, 10 or 11, we respectively get these trivial sequences):
%C S = 1, 1, 1, 1, 1, 1, 1, ...
%C S = 1, 10, 0, 0, 0, 0, 0, ...
%C S = 1, 11, 1, 1, 1, 1, 1, ...
%H Eric Angelini and Jean-Marc Falcoz, <a href="https://cinquantesignes.blogspot.com/2024/02/boomerang-sequences.html">Boomerang sequences</a>, Personal blog, Feb 1st 2024.
%e a(1) = 0, which multiplied by 0 gives 0
%e a(2) = 1, which multiplied by 1 gives 1
%e a(3) = 12
%e 1st digit is 1, which multiplied by 12 gives 12
%e 2nd digit is 2, which multiplied by 12 gives 24
%e a(4) = 24
%e 1st digit is 2, which multiplied by 24 gives 48
%e 2nd digit is 4, which multiplied by 24 gives 96
%e a(5) = 48
%e 1st digit is 4, which multiplied by 48 gives 192
%e 2nd digit is 8, which multiplied by 48 gives 384
%e a(6) = 96
%e 1st digit is 9, which multiplied by 96 gives 864
%e 2nd digit is 6, which multiplied by 96 gives 576
%e Etc. We see that the above last column reproduces S.
%t Join[{0,1},Nest[Flatten[IntegerDigits@#*#]&,{12},5]] (* _Giorgos Kalogeropoulos_, Feb 01 2024 *)
%o (Python)
%o from itertools import islice
%o from collections import deque
%o def agen(): # generator of terms
%o S = deque([24])
%o yield from [0, 1, 12]
%o while True:
%o an = S.popleft()
%o yield an
%o S.extend(an*d for d in map(int, str(an)))
%o print(list(islice(agen(), 54))) # _Michael S. Branicky_, Feb 01 2024
%Y Cf. A369603, A369604, A369823, A369824.
%K base,nonn
%O 1,3
%A _Eric Angelini_ and _Jean-Marc Falcoz_, Feb 01 2024