OFFSET
1,2
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..10000
FORMULA
a(a(n)) = n.
a(10*k) <= 10 for any k > 0.
a(5^k) = 5 for any k > 0.
a(p) = p for any prime number p.
EXAMPLE
For n = 140:
- 140 / 4 = 35, 35 / 5 = 7,
- 140 / 14 = 10,
- so a(140) = 7.
PROG
(PARI) { for (n=1, #a=vector(69, k, k), d=digits(n); s=setintersect(divisors(n), setbinop((u, v)->fromdigits(d[u..v]), [1..#d])); apply (t -> a[n]=min(a[n], a[n/t]), s[1..#s-1]); print1 (a[n]", ")) }
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Jul 25 2020
STATUS
approved