cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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).

Original entry on oeis.org

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

Views

Author

Robert Price, Sep 13 2020

Keywords

Examples

			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
		

Crossrefs

Programs

  • Mathematica
    Table[Length@  NestWhileList[# - Times @@ IntegerDigits[#] &, n, UnsameQ[##] &,
    2] - 2, {n, 0, 85}];(* Robert Price, Sep 13 2020 *)