OFFSET
1,2
COMMENTS
Empty product, 1, for n = 1.
a(p) = p if p is a prime.
LINKS
T. D. Noe, Table of n, a(n) for n = 1..200
FORMULA
a(n) = n!/A001783(n).
a(n) = Gauss_factorial(n, 1)/Gauss_factorial(n, n) (see A216919). - Peter Luschny, Oct 02 2012
EXAMPLE
a(7) = 7, a(9) = 3*6*9 = 162.
MAPLE
A066570 := proc(n) local i; mul(i, i=remove(k->igcd(n, k)=1, [$1..n])) end: # Peter Luschny, Oct 11 2011
MATHEMATICA
Table[Times @@ Select[Range[2, n], GCD[#, n] > 1 &], {n, 30}] (* T. D. Noe, Oct 04 2012 *)
PROG
(Sage)
def Gauss_factorial(N, n): return mul(j for j in (1..N) if gcd(j, n) == 1)
def A066570(n): return Gauss_factorial(n, 1)/Gauss_factorial(n, n)
[A066570(n) for n in (1..30)] # Peter Luschny, Oct 02 2012
(PARI) a(n) = prod(k=1, n, if (gcd(k, n) != 1, k, 1)); \\ Michel Marcus, Nov 02 2017
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Amarnath Murthy, Dec 19 2001
STATUS
approved