A383752 Product of nonzero remainders n mod p, over all primes p < n.
1, 1, 1, 1, 2, 1, 2, 6, 8, 3, 8, 10, 36, 24, 8, 30, 288, 420, 1920, 2268, 640, 270, 2880, 9240, 13824, 7560, 19200, 17820, 120960, 64064, 362880, 5054400, 1881600, 475200, 165888, 464100, 6386688, 4082400, 1228800, 2120580, 34836480, 23474880, 217728000
Offset: 1
Keywords
Links
- Paolo Xausa, Table of n, a(n) for n = 1..1000
Programs
-
Mathematica
A383752[n_] := Times @@ DeleteCases[Mod[n, Prime[Range[PrimePi[n - 2]]]], 0]; Array[A383752, 50] (* Paolo Xausa, Jun 05 2025 *)
-
PARI
a(n) = vecprod(select(x->(x!=0), apply(lift, apply(x->Mod(n, x), primes([2,n-1]))))); \\ Michel Marcus, May 28 2025
-
Python
from sympy import primerange def a(n): s = 1 for p in primerange(0, n): if p > (n >> 1): s *= (n-p) elif (x:= n % p) > 0: s*= x return s print([a(n) for n in range(1,41)])
Formula
a(p) = A102647(p) if p prime.