login
Largest digit in the decimal expansion of 1/n.
13

%I #32 Feb 07 2022 21:46:09

%S 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,

%T 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,

%U 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

%N Largest digit in the decimal expansion of 1/n.

%H <a href="/index/1#1overn">Index entries for sequences related to decimal expansion of 1/n</a>

%F a(n) = max_{i=0..n} (floor(10^i/n) mod 10).

%F a(10*n) = a(n) and a(n) = n iff n = 1, 3, 6. - _Bernard Schott_, Mar 19 2020

%e a(50) = 2 because the largest digit in 1/50 = 0.02 is 2.

%t a[n_] := Max@RealDigits[1/n][[1]]; Array[a, 88] (* _Giovanni Resta_, Mar 12 2020 *)

%o (Python)

%o from sympy import n_order, multiplicity

%o def A333236(n):

%o m2, m5 = multiplicity(2,n), multiplicity(5,n)

%o return int(max(str(10**(max(m2,m5)+n_order(10,n//2**m2//5**m5))//n))) # _Chai Wah Wu_, Feb 07 2022

%Y Cf. A333237 (a(n) = 9), A333402 (a(n) = 1).

%K nonn,base,easy

%O 1,2

%A _Andrew Slattery_, Mar 12 2020

%E More terms from _Giovanni Resta_, Mar 12 2020