squaresum
Squaresum is the term used for a sum of squares of integers. In general, a squaresum expresses a natural number n as n = a1^2 + a2^2 + ... + ak^2, where the ai are integers and k is a positive integer. This concept lies at the heart of classical results in number theory and has geometric interpretation as the squared Euclidean length of a vector.
A central topic is representability as a sum of two squares. Fermat’s two-square theorem states that a
Beyond two squares, Legendre’s three-square theorem characterizes sums of three squares: a natural number n is
The two-square case also has a representation-count formula: the number r2(n) of representations of n as a^2
Squaresums appear in geometry as the squared norm of vectors and in various algorithms for finding representations