cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A383752 Product of nonzero remainders n mod p, over all primes p < n.

This page as a plain text file.
%I A383752 #69 Jun 06 2025 14:46:14
%S A383752 1,1,1,1,2,1,2,6,8,3,8,10,36,24,8,30,288,420,1920,2268,640,270,2880,
%T A383752 9240,13824,7560,19200,17820,120960,64064,362880,5054400,1881600,
%U A383752 475200,165888,464100,6386688,4082400,1228800,2120580,34836480,23474880,217728000
%N A383752 Product of nonzero remainders n mod p, over all primes p < n.
%H A383752 Paolo Xausa, <a href="/A383752/b383752.txt">Table of n, a(n) for n = 1..1000</a>
%F A383752 a(p) = A102647(p) if p prime.
%t A383752 A383752[n_] := Times @@ DeleteCases[Mod[n, Prime[Range[PrimePi[n - 2]]]], 0];
%t A383752 Array[A383752, 50] (* _Paolo Xausa_, Jun 05 2025 *)
%o A383752 (Python)
%o A383752 from sympy import primerange
%o A383752 def a(n):
%o A383752     s = 1
%o A383752     for p in primerange(0, n):
%o A383752         if p > (n >> 1): s *= (n-p)
%o A383752         elif (x:= n % p) > 0: s*= x
%o A383752     return s
%o A383752 print([a(n) for n in range(1,41)])
%o A383752 (PARI) a(n) = vecprod(select(x->(x!=0), apply(lift, apply(x->Mod(n, x), primes([2,n-1]))))); \\ _Michel Marcus_, May 28 2025
%Y A383752 Cf. A000040, A024934, A013939, A102647, A309912.
%K A383752 nonn
%O A383752 1,5
%A A383752 _DarĂ­o Clavijo_, May 28 2025