login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

A336682
a(n) is the number of iterations needed to reach a fixed point starting with n and repeatedly applying f(x) = x - (the product of the digits of x).
1
0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 3, 3, 3, 3, 1, 2, 2, 2, 2, 0, 3, 4, 4, 3, 3, 3, 2, 2, 2, 0, 4, 5, 3, 4, 1, 3, 3, 2, 2, 0, 2, 1, 4, 1, 2, 1, 3, 1, 2, 0, 2, 3, 6, 4, 1, 4, 3, 3, 2, 0, 7, 2, 3, 6, 4
OFFSET
0,22
LINKS
EXAMPLE
a(42) = 4 because:
1: 42 - 4*2 = 34
2: 34 - 3*4 = 22
3: 22 - 2*2 = 18
4: 18 - 1*8 = 10
5: 10 - 1*0 = 10
MATHEMATICA
Table[Length@ NestWhileList[# - Times @@ IntegerDigits[#] &, n, UnsameQ[##] &,
2] - 2, {n, 0, 85}]; (* Robert Price, Sep 13 2020 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Robert Price, Sep 13 2020
STATUS
approved