SquaresR[d,n]
gives the number of ways to represent the integer n as a sum of d squares.


SquaresR
SquaresR[d,n]
gives the number of ways to represent the integer n as a sum of d squares.
Examples
open all close allBasic Examples (3)
Applications (2)
Number of lattice points inside the circle of radius 20 with center at the origin:
Approximation of the Sierpiński constant:
Properties & Relations (4)
The number of representations as the sum of two squares:
PowersRepresentations enumerates the ordered representations up to units:
The ZTransform:
The generating function for SquaresR:
FindSequenceFunction can recognize the SquaresR sequence:
See Also
Tech Notes
Related Guides
History
Text
Wolfram Research (2007), SquaresR, Wolfram Language function, https://reference.wolfram.com/language/ref/SquaresR.html.
CMS
Wolfram Language. 2007. "SquaresR." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/SquaresR.html.
APA
Wolfram Language. (2007). SquaresR. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SquaresR.html
BibTeX
@misc{reference.wolfram_2025_squaresr, author="Wolfram Research", title="{SquaresR}", year="2007", howpublished="\url{https://reference.wolfram.com/language/ref/SquaresR.html}", note=[Accessed: 07-August-2025]}
BibLaTeX
@online{reference.wolfram_2025_squaresr, organization={Wolfram Research}, title={SquaresR}, year={2007}, url={https://reference.wolfram.com/language/ref/SquaresR.html}, note=[Accessed: 07-August-2025]}