Ramanujan's Lost Notebook Part II, Ch. 12: ch12Reps
DefinitionRamanujanLostNotebook_PartII_ch12_ch12Repsnumber-theoryramanujan-lost-notebook
Canonical representatives of primitive sums of two squares: c>d>0, c²+d²=μ, gcd(c,d)=1. The exceptional orbits μ=1,2 are handled separately. One such pair represents each sign/interchange orbit of Definition 11.4.1.
Definition code
import Mathlib
namespace RamanujanLostNotebook.PartII
/-- Canonical representatives of primitive sums of two squares: c>d>0,
c²+d²=μ, gcd(c,d)=1. The exceptional orbits μ=1,2 are handled separately.
One such pair represents each sign/interchange orbit of Definition 11.4.1. -/
def ch12Reps (mu : ℕ) : Finset (ℕ × ℕ) :=
((Finset.range (mu + 1)).product (Finset.range (mu + 1))).filter
(fun cd => 0 < cd.2 ∧ cd.2 < cd.1 ∧ cd.1 ^ 2 + cd.2 ^ 2 = mu ∧
Nat.Coprime cd.1 cd.2)
end RamanujanLostNotebook.PartII
Source
G. E. Andrews and B. C. Berndt, Ramanujan's Lost Notebook, Part II, Springer 2009, Chapter 12.