OFFSET
1,5
COMMENTS
a(n) is zero where n is composite and is trivially less than or equal to n! when n is prime or 1.
a(n)=0 iff n is composite. See A180492. - Robert G. Wilson v, Sep 09 2010
FORMULA
EXAMPLE
a(7) = (7 mod 2) * (7 mod 3) * (7 mod 4) * (7 mod 5) * (7 mod 6) = 1 * 1 * 3 * 2 * 1 = 6.
MAPLE
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
MATHEMATICA
f[n_] := Times @@ Mod[n, Range[2, n - 1]]; Array[f, 42] (* Robert G. Wilson v, Sep 09 2010 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Carl R. White, Sep 08 2010
STATUS
approved