login
A376286
n! less trailing zeros (A004154) (mod nextprime(n)).
1
1, 1, 2, 1, 4, 5, 2, 9, 6, 10, 10, 3, 10, 7, 13, 11, 6, 8, 11, 15, 7, 9, 14, 13, 22, 20, 27, 4, 25, 16, 17, 7, 2, 29, 24, 10, 27, 3, 32, 18, 31, 21, 22, 15, 2, 9, 38, 26, 29, 43, 48, 10, 43, 55, 20, 51, 24, 11, 48, 2, 12, 57, 50, 1, 64, 14, 53, 8, 47
OFFSET
0,3
FORMULA
a(n) = A004154(n) mod A151800(n).
MATHEMATICA
a[n_] := Mod[n!/10^IntegerExponent[n!, 10], NextPrime[n]]; Array[a, 69, 0](* Becomes quicker as n increases and it uses less resources. For me, this is around 2 million *)g[n_, p_] := Block[{s = 0, e = 1}, While[t = Floor[n/p^e]; t > 0, s += t; e++]; s]; f[n_] := Block[{m = NextPrime@ n, p = 1, q = 7}, p = PowerMod[2, g[n, 2] - g[n, 5], m]; p = Mod[p*PowerMod[3, g[n, 3], m], m]; While[q < n +1, p = Mod[p*PowerMod[q, g[n, q], m], m]; q = NextPrime@ q]; p]
PROG
(Python)
from functools import reduce
from sympy import nextprime
from sympy.ntheory.factor_ import digits
def A376286(n): return ((p:=nextprime(n))-1)*pow(reduce(lambda i, j:i*j%p, range(n+1, p), 1), -1, p)*pow(10, sum(digits(n, 5)[1:])-n>>2, p)%p # Chai Wah Wu, Oct 18 2024
CROSSREFS
Sequence in context: A209153 A209141 A038719 * A125751 A210860 A099492
KEYWORD
easy,base,nonn,changed
AUTHOR
Robert G. Wilson v, Sep 18 2024
STATUS
approved