MathOverflow is a question and answer site for professional mathematicians. 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

Define $\delta (0)=1$ and $\delta (x) = 0$ when $x \neq 0$.

Can we find a "good" method or algorithm to work out $$ S(n) = \sum_{k_1=0}^{n-1} \sum_{k_2=0}^{n-1} \cdots \sum_{k_n=0}^{n-1} \delta (\mathrm{e}^{2 \pi k_1 \mathrm{i} /n} + \mathrm{e}^{2 \pi k_2 \mathrm{i} /n} + \cdots + \mathrm{e}^{2 \pi k_n \mathrm{i} /n})$$

with any positive integer $n$?

(It's easy to count this when $n=p^l$ or $n=pq$. In particular, $S(p)=p!$ is obvious.)

share|cite|improve this question
I get $0, 2, 6, 36, 120, 2040, 5040, 190120, 640080, 32458860$ for $n = 1$ to $10$. This sequence does not seem to be in the OEIS. – Robert Israel Dec 24 '12 at 19:01

Your Answer


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

Browse other questions tagged or ask your own question.