"PowersRepresentations[n,k,p] gives the distinct representations of the integer n as a sum of k non-negative p-th integer powers"
Documentation: PowersRepresentations
How does Mathematica do this computation so quickly? Is there a fast algorithm? What is it?
I am particularly interested in the case where $n$ is the sum of $k$ squares of positive integers.