FLINT3.7.0-dev

_fmpq_poly_legendre_p

Synopsis#include <flint/fmpq_poly.h>
void _fmpq_poly_legendre_p(fmpz * coeffs, fmpz_t den, ulong n)source

Sets coeffs to the coefficient array of the Legendre polynomial P_n(x), defined by (n+1) P_{n+1}(x) = (2n+1) x P_n(x) - n P_{n-1}(x), for n\ge0. Sets den to the overall denominator. The coefficients are calculated using a hypergeometric recurrence in integer arithmetic. The length of the array will be n+1. The denominator is given by \gcd(n!,2^n) = 2^{\lfloor n/2 \rfloor + \lfloor n/4 \rfloor + \ldots}. See fmpz_poly for the shifted Legendre polynomials.

Cite this page

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