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
Giorgos Kalogeropoulos and Eric Angelini, Sep 25 2023
STATUS
approved