Maths WorkshopMaths problems with full solutions
Exercise 2114Number theory › CongruencesM1Added 3 Nov 2026

NTT and modular arithmetic (statement)

#NTT#number theory transform#FFT#modular

Statement

Describe the Number Theoretic Transform (NTT) and explain why it requires n∣p−1n\mid p-1 for a prime pp.

Hint

The NTT is FFT over a finite field. An nn-th primitive root of unity exists in Fp\mathbb{F}_p iff n∣p−1n\mid p-1.

Show solutionHide solution

Solution

Definition. The NTT computes the discrete Fourier transform over Z/pZ\mathbb{Z}/p\mathbb{Z}: a^k=∑jajωjk\hat a_k=\sum_j a_j\omega^{jk}, where ω\omega is an nn-th primitive root of unity mod pp.

Existence of ω\omega. By the structure of Fp∗\mathbb{F}_p^* (cyclic of order p−1p-1), Fp∗\mathbb{F}_p^* contains an element of order nn iff n∣p−1n\mid p-1.

Application. Fast polynomial multiplication over Z/pZ\mathbb{Z}/p\mathbb{Z} via NTT with O(nlog⁡n)O(n\log n) complexity, used in computer algebra and cryptography.

Conclusion. The NTT requires p≡1(modn)p\equiv1\pmod n; typical choices use p=k⋅2m+1p=k\cdot 2^m+1.