The roots of unity filter extracts the terms of a formal power series whose exponents lie in a specified residue
class, by averaging suitable substitutions of roots
of unity. Let
have complex coefficients,
let
be a positive integer, and let
. For
, the filtered series is
The multiplier of
on the left is the average of
over
. The geometric
series gives zero unless
, when every summand
is 1 (Wilf 1994). Extracting these subsequences of coefficients
is known as multisection of a series.
For example, the coefficient of in
counts subsets
of
with element sum
. For a positive
integer
, the polynomial has
value
at 1 and
at each nontrivial fifth root of unity. In the latter
case each block of five factors has product 2, since it runs over all fifth roots
of unity in the identity
,
where
. Filtering for multiples of 5 and evaluating
at 1 therefore gives
such subsets.
3Blue1Brown (2022) illustrates the case
.