FLINT3.7.0-dev

dirichlet_char_next

Synopsis#include <flint/dirichlet.h>
int dirichlet_char_next(dirichlet_char_t x, const dirichlet_group_t G)source

Sets x to the next element of G in the lexicographic order of the logs (the last component varying fastest), updating the number with one multiplication. Returns the index of the most significant component that changed, or -1 after the last element (when x wraps around to the principal character).

This enumerates the characters in an order that looks random in terms of the numbers. A loop over all characters:

dirichlet_char_one(chi, G);
do {
    /* use chi */
} while (dirichlet_char_next(chi, G) >= 0);

Guides#

Cite this page

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