NTLib - Number Theory Library 0.9
Loading...
Searching...
No Matches
pell_equation Module Reference

Finds integer solutions to Pell's equation. More...

Functions

template<Integer T>
constexpr std::tuple< T, T > ntlib::pell_fundamental_solution (T D) noexcept
 Compute the fundamental solution.
template<Integer T>
constexpr std::tuple< T, T > ntlib::pell_next_solution (T D, const std::tuple< T, T > &initial, const std::tuple< T, T > &current) noexcept
 Generates the next larger solution to Pell's equation.

Detailed Description

Finds integer solutions to Pell's equation.

Given a non-square integer \(D \in \mathbb{N}\), finds integers \(x, y \in \mathbb{Z}\) satisfying \(x^2 - D \cdot y^2 = 1\).

Files

file  modules/diophantine/pell_equation.cpp
 Primary module interface unit for module pell_equation.