dirichlet_group_num_primitive
Synopsis
#include <flint/dirichlet.h>ulong dirichlet_group_num_primitive(const dirichlet_group_t G)sourceReturns the number of primitive characters modulo q: 0 if q \equiv 2 \pmod 4, and otherwise the product over the components of p - 2 for p^1 \| q (p odd), (p-1)^2 p^{e-2} for p^e \| q (e \ge 2), 1 for 4 \| q and 2^{e-2} for 2^e \| q, e \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-10-20).
@misc{flint-doc-dirichlet-dirichlet-group-num-primitive,
author = {{The FLINT team}},
title = {{dirichlet\_group\_num\_primitive (dirichlet.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/dirichlet/dirichlet_group_num_primitive.html},
note = {Generated 2026-10-20}
}