OFFSET
1,3
COMMENTS
If p is prime, then a(p) = (p-1)!. - Stefan Steinerberger, Jun 08 2006
FORMULA
a(n) = Product_{d|n} pxi(d), where pxi(m) = is the product of totatives of m (A001783). - Jaroslav Krizek, Dec 28 2016
MAPLE
a:=n->mul(numer (k/n), k=1..n): seq(a(n), n=1..23); # Zerinvary Lajos, Apr 26 2008
MATHEMATICA
a[n_] := Product[i/GCD[i, n], {i, 1, n}]; Table[a[n], {n, 1, 30}] (* Stefan Steinerberger, Jun 08 2006 *)
Table[Product[Times @@ Select[Range@ d, CoprimeQ[#, d] &], {d, Divisors@ n}], {n, 23}] (* Michael De Vlieger, Dec 28 2016 *)
PROG
(PARI) a(n) = prod(i=1, n, i/gcd(i, n))
(Magma) [&*[&*[h: h in [1..d] | GCD(h, d) eq 1]: d in Divisors(n)]: n in [1..100]]; // Jaroslav Krizek, Dec 28 2016
CROSSREFS
KEYWORD
nonn
AUTHOR
Martin Fuller, Jun 06 2006
EXTENSIONS
More terms from Stefan Steinerberger, Jun 08 2006
STATUS
approved