A333236 Largest digit in the decimal expansion of 1/n.
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
Examples
a(50) = 2 because the largest digit in 1/50 = 0.02 is 2.
Programs
-
Mathematica
a[n_] := Max@RealDigits[1/n][[1]]; Array[a, 88] (* Giovanni Resta, Mar 12 2020 *)
-
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
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
Extensions
More terms from Giovanni Resta, Mar 12 2020
Comments