login
A333236
Largest digit in the decimal expansion of 1/n.
13
1, 5, 3, 5, 2, 6, 8, 5, 1, 1, 9, 8, 9, 8, 6, 6, 9, 5, 9, 5, 9, 5, 9, 6, 4, 8, 7, 8, 9, 3, 9, 5, 3, 9, 8, 7, 7, 9, 6, 5, 9, 9, 9, 7, 2, 9, 9, 8, 9, 2, 9, 9, 9, 8, 8, 8, 9, 9, 9, 6, 9, 9, 8, 6, 8, 5, 9, 9, 9, 8, 9, 8, 9, 5, 3, 9, 9, 8, 8, 5, 9, 9, 9, 9, 9, 9, 9, 6, 9, 1, 9, 9, 8, 9, 9, 6, 9, 9, 1, 1, 9, 9, 9, 9, 9
OFFSET
1,2
FORMULA
a(n) = max_{i=0..n} (floor(10^i/n) mod 10).
a(10*n) = a(n) and a(n) = n iff n = 1, 3, 6. - Bernard Schott, Mar 19 2020
EXAMPLE
a(50) = 2 because the largest digit in 1/50 = 0.02 is 2.
MATHEMATICA
a[n_] := Max@RealDigits[1/n][[1]]; Array[a, 88] (* Giovanni Resta, Mar 12 2020 *)
PROG
(Python)
from sympy import n_order, multiplicity
def A333236(n):
m2, m5 = multiplicity(2, n), multiplicity(5, n)
return int(max(str(10**(max(m2, m5)+n_order(10, n//2**m2//5**m5))//n))) # Chai Wah Wu, Feb 07 2022
CROSSREFS
Cf. A333237 (a(n) = 9), A333402 (a(n) = 1).
Sequence in context: A176036 A194624 A239805 * A270915 A319461 A201762
KEYWORD
nonn,base,easy
AUTHOR
Andrew Slattery, Mar 12 2020
EXTENSIONS
More terms from Giovanni Resta, Mar 12 2020
STATUS
approved