%I #10 Nov 02 2024 04:24:59
%S 1,1,1,0,2,0,6,0,0,0,720,0,2160,0,0,0,2419200,0,65318400,0,0,0,
%T 754427520000,0,0,0,0,0,32953394073600000,0,311409573995520000,0,0,0,
%U 0,0,37269497815783833600000,0,0,0,7890485108998805913600000000,0
%N Product of remainders of n mod k, for k = 2,3,4,...,n-1.
%C a(n) is zero where n is composite and is trivially less than or equal to n! when n is prime or 1.
%C a(n)=0 iff n is composite. See A180492. - _Robert G. Wilson v_, Sep 09 2010
%F a(n) = A080339(n)*A173392(n). - _Ridouane Oudra_, Nov 01 2024
%e a(7) = (7 mod 2) * (7 mod 3) * (7 mod 4) * (7 mod 5) * (7 mod 6) = 1 * 1 * 3 * 2 * 1 = 6.
%p a:=proc(n) if n=1 then 1; elif isprime(n)=true then mul(n mod i, i=2..n-1); else 0; fi: end: seq(a(n), n=1..60); # _Ridouane Oudra_, Nov 01 2024
%t f[n_] := Times @@ Mod[n, Range[2, n - 1]]; Array[f, 42] (* _Robert G. Wilson v_, Sep 09 2010 *)
%Y Cf. A034386, A000142, A004125, A180492, A180493.
%Y Cf. A080339, A173392.
%K nonn
%O 1,5
%A _Carl R. White_, Sep 08 2010