login
A277543
a(n) = n/5^m mod 5, where 5^m is the greatest power of 5 that divides n.
6
1, 2, 3, 4, 1, 1, 2, 3, 4, 2, 1, 2, 3, 4, 3, 1, 2, 3, 4, 4, 1, 2, 3, 4, 1, 1, 2, 3, 4, 1, 1, 2, 3, 4, 2, 1, 2, 3, 4, 3, 1, 2, 3, 4, 4, 1, 2, 3, 4, 2, 1, 2, 3, 4, 1, 1, 2, 3, 4, 2, 1, 2, 3, 4, 3, 1, 2, 3, 4, 4, 1, 2, 3, 4, 3, 1, 2, 3, 4, 1, 1, 2, 3, 4, 2, 1
OFFSET
1,2
COMMENTS
a(n) is the rightmost nonzero digit in the base 5 expansion of n (A007091).
LINKS
FORMULA
a(n) = A132739(n) mod 5 = A010874(A132739(n)). - Michel Marcus, Oct 20 2016
EXAMPLE
a(20) = (20/5 mod 5) = 4.
MATHEMATICA
Table[Mod[n/5^IntegerExponent[n, 5], 5], {n, 1, 160}]
PROG
(PARI) a(n) = n/5^valuation(n, 5) % 5; \\ Michel Marcus, Oct 20 2016
CROSSREFS
Cf. A277550, A277551, A277555, A277548 (positions of 1, 2, 3 and 4 in this sequence).
Sequence in context: A138297 A374724 A139458 * A190594 A338803 A104412
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Oct 19 2016
STATUS
approved