FLINT3.7.0-dev

dlog_vec_pindex_factorgcd

Synopsis#include <flint/dlog.h>
ulong dlog_vec_pindex_factorgcd(ulong * v, ulong nv, ulong p, nmod_t mod, ulong a, ulong na, ulong loga, ulong logm1, nmod_t order, int maxtry)source

Tries to find the logarithm of the prime p from the logarithms already stored in v: for i = 1, 2, \ldots up to maxtry, writes p a^i \equiv \pm r/u \pmod m with r, u about \sqrt m by a partial extended Euclidean algorithm, and if r and u factor over the entries of v already known (after removing primes below p/4), returns \log r - \log u - i \log a (adjusted by logm1, the logarithm of -1). Here loga is the value to use for \log a. Returns DLOG_NOT_FOUND if no relation is found.

Cite this page

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