login
A339255
Leading digit of n in base 5.
3
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, 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, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3
OFFSET
1,2
FORMULA
a(n) = floor(n / 5^floor(log_5(n))).
G.f.: (x + Sum_{k>=0} Sum_{d=2..4} (x^(d*5^k)-x^(5^(k+1))) )/(1-x).
MATHEMATICA
IntegerDigits[#, 5][[1]]&/@Range[100] (* Harvey P. Dale, Sep 04 2021 *)
PROG
(PARI) a(n) = n\5^logint(n, 5);
CROSSREFS
Cf. A007091 (base 5), A073851 (partial sums).
Sequence in context: A346689 A071498 A255825 * A086198 A086196 A373063
KEYWORD
base,nonn
AUTHOR
Kevin Ryde, Nov 28 2020
STATUS
approved