login
A365260
Number of steps for n to stop, according to the "multiply with zero" rules explained in A365994.
4
2, 6, 2, 8, 8, 3, 2, 4, 2, 4, 4, 2, 2, 3, 5, 8, 7, 5, 2, 6, 2, 9, 3, 5, 2, 3, 2, 11, 4, 7, 2, 6, 2, 11, 4, 2, 4, 5, 2, 10, 3, 2, 12, 5, 2, 5, 4, 6, 2, 5, 2, 4, 3, 9, 6, 3, 3, 5, 5, 16, 2, 13, 2, 2, 10, 7, 5, 7, 2, 4, 3, 2, 5, 5, 11, 16, 7, 10, 4, 8, 2, 4, 7, 3, 10, 4, 2, 11, 3, 3, 2, 3, 2, 4, 3, 5, 2, 5, 5, 7
OFFSET
1,1
COMMENTS
a(n) = 60 has the longest trajectory (16 steps) for n < 300.
LINKS
Eric Angelini, Multiply with zero, personal blog "Cinquante signes" Sept. 2023.
EXAMPLE
The trajectory of 1 is "1, 101, stop", 2 steps;
The trajectory of 2 is "2, 102, 1706, 20853, 210993, 3981053, stop", 6 steps;
The trajectory of 3 is "3, 103, stop", 2 steps;
The trajectory of 4 is "4, 104, 1308, 20654, 230898, 2654087, 35907393, 1196913103, stop", 8 steps; etc.
MATHEMATICA
Table[Length@Most@NestWhileList[(d=Divisors@#;
Min[Select[FromDigits@Flatten[IntegerDigits/@Riffle[#, 0]]&/@Table[{d[[k]], d[[Length@d-k+1]]}, {k, Length@d}], Count[IntegerDigits@#, 0]<2&]])&, k, IntegerQ], {k, 100}]
PROG
(Python)
from sympy import divisors
def a(n):
k, steps = n, 1
while True:
s = set()
for d in divisors(k, generator=True):
v, w = str(d), str(k//d)
if "0" not in v and "0" not in w:
s.add(int(v + "0" + w))
if len(s) == 0: return steps
k, steps = min(s), steps + 1
print([a(n) for n in range(1, 101)]) # Michael S. Branicky, Sep 26 2023
CROSSREFS
KEYWORD
base,nonn
AUTHOR
STATUS
approved