FLINT3.7.0-dev

dirichlet_group_num_primitive

Synopsis#include <flint/dirichlet.h>
ulong dirichlet_group_num_primitive(const dirichlet_group_t G)source

Returns the number of primitive characters modulo qq: 0 if q≡2(mod4)q \equiv 2 \pmod 4, and otherwise the product over the components of p−2p - 2 for p1∥qp^1 \| q (pp odd), (p−1)2pe−2(p-1)^2 p^{e-2} for pe∥qp^e \| q (e≥2e \ge 2), 1 for 4∥q4 \| q and 2e−22^{e-2} for 2e∥q2^e \| q, e≥3e \ge 3.

Guides#

Cite this page

The FLINT team, “dirichlet_group_num_primitive (dirichlet.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/dirichlet/dirichlet_group_num_primitive.html (generated 2026-11-02).