OFFSET
1,2
COMMENTS
a(n) = 9 for almost all n. - Charles R Greathouse IV, Mar 20 2012
With an offset of 1 rather than 0, A016186 tells us how many integers among the first 10^n have 9s among their digits, and those numbers are therefore guaranteed to index a 9 in this sequence. More interesting of course are those numbers that don't have a 9 in their own digits but do have a 9 among the digits of their nontrivial divisors. - Alonso del Arte, Mar 23 2012
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..10000
EXAMPLE
a(12) = 6 because digit 6 is largest digit of all divisors of 12: (1, 2, 3, 4, 6, 12).
MATHEMATICA
Flatten[Table[Take[Sort[Flatten[IntegerDigits[Divisors[n]]]], -1], {n, 100}]] (* Alonso del Arte, Mar 23 2012 *)
PROG
(PARI) a(n)=my(t); fordiv(n, d, t=max(t, vecmax(eval(Vec(Str(d))))); if(t>8, return(t))); t \\Charles R Greathouse IV, Mar 20 2012
(Python)
from sympy import divisors
def a(n): return int(max("".join(map(str, divisors(n)))))
print([a(n) for n in range(1, 88)]) # Michael S. Branicky, Feb 22 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Jaroslav Krizek, Mar 20 2012
STATUS
approved