Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How could we derive a closed form for $\prod\limits_{i=1}^{n} i^{[(i,n)=1]}$?

Here "$[s]$" is the Iverson bracket and "$(a,b)$" is the greatest common divisor.

share|cite|improve this question
I don't think it is derivable but I would call it an Eulerial. :) I guess some bounds can be derived from those that are known for the totient function itself.… – Dan Brumleve Oct 11 '11 at 9:14
More a restatement than a closed form, but: $\prod\limits_{k=1}^{n-1} k^{[\gcd(k,n)=1]}$ would be a compact way of putting it. Here $[p]$ is the Iversonian bracket. – J. M. Oct 11 '11 at 9:28
BTW: there doesn't seem to be a closed form, but the product of all totatives of a number is listed in the OEIS. – J. M. Oct 11 '11 at 9:37
@J.M:Wow,thanks for updating me with those names (totatives/iverson),Btw is it iversonian or iverson bracket ... – Quixotic Oct 11 '11 at 9:41
"Iversonian bracket" and "Iverson bracket" are the same thing. :) – J. M. Oct 11 '11 at 9:45
up vote 3 down vote accepted

This is called a Gauss Factorial, and is used frequently in Modular arithmetic. It satisfies a theorem analogous to Wilson's Theorem, and can be also be thought of the $p$-adic gamma function.

Define $$N_n !:=\prod_{{1\leq j\leq N}\atop{\gcd(j,n)=1}} j.$$

We have the following congruence: $$(n-1)_n!\equiv \begin{cases} -1\pmod n & \text{for }n=2,4,p^{\alpha},p^{2\alpha}\\ 1\pmod n & \text{otherwise} \end{cases}$$

Lastly, $$\Gamma_p(z)=\lim_{N\to z} (-1)^N (N-1)_p !$$ where $N$ runs through any sequence of positive integers $p$-adically approaching $z$.

Remark: If you want some other form, inclusion exclusion implies that for squarefree $n$, $$n_n! =n!\prod_{d|n}\left(d^{\frac{n}{d}}\left(\frac{n}{d}\right)!\right)^{\mu(d)}, $$ where $\mu$ is the Möbius function.

share|cite|improve this answer
If there's no closed form, and it shows up a lot anyway, then make it your own closed form... – J. M. Oct 11 '11 at 10:36

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.