%I #11 Sep 04 2021 19:12:50
%S 1,2,3,4,1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,4,4,4,4,4,1,1,1,1,1,1,1,1,1,1,
%T 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
%U 2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3
%N Leading digit of n in base 5.
%H Kevin Ryde, <a href="/A339255/b339255.txt">Table of n, a(n) for n = 1..10000</a>
%F a(n) = floor(n / 5^floor(log_5(n))).
%F G.f.: (x + Sum_{k>=0} Sum_{d=2..4} (x^(d*5^k)-x^(5^(k+1))) )/(1-x).
%t IntegerDigits[#,5][[1]]&/@Range[100] (* _Harvey P. Dale_, Sep 04 2021 *)
%o (PARI) a(n) = n\5^logint(n,5);
%Y Cf. A007091 (base 5), A073851 (partial sums).
%Y In other bases: A122586, A122587, A339256, A000030, A099563, A276153.
%K base,nonn
%O 1,2
%A _Kevin Ryde_, Nov 28 2020