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 pp from the logarithms already stored in vv: for i=1,2,…i = 1, 2, \ldots up to maxtry, writes pai≡±r/u(modm)p a^i \equiv \pm r/u \pmod m with r,ur, u about m\sqrt m by a partial extended Euclidean algorithm, and if rr and uu factor over the entries of vv already known (after removing primes below p/4p/4), returns log⁡r−log⁡u−ilog⁡a\log r - \log u - i \log a (adjusted by logm1, the logarithm of −1-1). Here loga is the value to use for log⁡a\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-11-02).