FLINT3.7.0-dev

dirichlet_group_init

Synopsis#include <flint/dirichlet.h>
int dirichlet_group_init(dirichlet_group_t G, ulong q)source

Initialises GG as the group of characters modulo q≥1q \ge 1, computing the factorisation of qq, the Conrey generators and the exponent. No discrete logarithm tables are computed, so this is cheap even for large qq. Returns 1 on success, and 0 (without allocating) if a prime factor of qq exceeds 101610^{16}, for which the generator is not implemented.

For an odd prime pp the Conrey generator is the smallest positive integer that is a primitive root modulo p2p^2, hence modulo every pep^e. It equals the smallest primitive root modulo pp except for p=40487p = 40487 and p=6692367337p = 6692367337, the only such primes below 101610^{16}. For qq divisible by 8, the components for the 2-part are generated by −1-1 and 55; for 4∥q4 \| q by −1-1; for 2∥q2 \| q there is no component.

Guides#

Cite this page

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