OFFSET
1,3
COMMENTS
The convention for the empty product here is 1. The second product exists for all numbers greater than 210. See A141098.
Conjecture: For odd n, if a(n) == -1 (mod n) then n must be a prime power.
EXAMPLE
For n=6 there are no prime totatives between 2 and 4 and there are also no composite totative pairs which add to 6 so both products do not exist and a(6)=n-1=5.
For n=25 these products exist and are given -44618574^2*12096 == 4 (mod 25). Therefore, a(25)=4.
PROG
(PARI) a(n)= {prod_p=1; prod_r=1; for(k=2, n-2, if(gcd(k, n)==1, if(isprime(k), prod_p=prod_p*k*(n-k); ); if(!isprime(k) && !isprime(n-k), prod_r=prod_r*k; ); ); ); (-prod_p*prod_r)%n; }
CROSSREFS
KEYWORD
nonn
AUTHOR
Craig J. Beisel, Mar 23 2022
STATUS
approved