login
A374015
Residue modulo 5 of n! divided by the highest power of 10 which divides n!.
1
1, 1, 2, 1, 4, 2, 2, 4, 2, 3, 3, 3, 1, 3, 2, 3, 3, 1, 3, 2, 4, 4, 3, 4, 1, 4, 4, 3, 4, 1, 3, 3, 1, 3, 2, 2, 2, 4, 2, 3, 2, 2, 4, 2, 3, 1, 1, 2, 1, 4, 2, 2, 4, 2, 3, 4, 4, 3, 4, 1, 1, 1, 2, 1, 4, 1, 1, 2, 1, 4, 3, 3, 1, 3, 2, 4, 4, 3, 4, 1, 3, 3, 1, 3, 2, 2, 2, 4, 2, 3, 2, 2, 4, 2, 3, 1, 1, 2, 1, 4, 4, 4, 3, 4, 1, 3
OFFSET
0,3
COMMENTS
The sequence is not eventually periodic. This because by induction on k the eventual period must be a multiple of 5^k for every k.
Each residue modulo 5 except 0 occurs infinite number of times since a(5^k) = 2^k mod 5.
If n > 0 is not divisible by 5, a(n) == n * a(n-1) (mod 5). - Robert Israel, Jul 05 2024
LINKS
FORMULA
a(n) = A010874(A004154(n)).
EXAMPLE
a(5) = 1*2*3*4*5/10 mod 5 = 2.
MAPLE
a:= n-> (f-> irem(f/10^padic[ordp](f, 10), 5))(n!):
seq(a(n), n=0..105); # Alois P. Heinz, Jun 25 2024
MATHEMATICA
a[n_]:=Mod[n!/10^IntegerExponent[n!, 10], 5]; Array[a, 106, 0] (* Stefano Spezia, Jun 25 2024 *)
PROG
(Python)
# prints the first 100 terms of the sequence
t=1
for i in range(100):
p=i if i else 1
while p%5==0:
p//=5
t*=3
t=(p*t)%5
print(t, end=', ')
CROSSREFS
KEYWORD
nonn
AUTHOR
Cezary Glowacz, Jun 25 2024
STATUS
approved