# Undocumented function SumOfSquaresReps

There is an interesting (and documented) number-theoretic function in MMA called PowersRepresentations[$n$, $k$, $p$].

It gives the distinct representations of the integer $n$ as a sum of $k$ non-negative $p$-th integer powers.

I recently heard about related undocumented function SumOfSquaresReps.

How can I find out more on that undocumented function (number of arguments etc.)? What does it do exactly? How does it relate to PowersRepresentations, esp. performance-wise? Is there SumOfCubesReps, etc.?

The only place on the Internet known to me where this function is mentioned and used is @kglr answer to a question on this site.

Related:

How does Mathematica compute how to write integers as the sum of k non-negative pth integer powers so quickly?

• "number of arguments etc." - as you can surmise from kglr's answer, it takes two arguments: ReduceSumOfSquaresReps[k, n] returns all possible lists of k positive integers whose squares sum to n. – J. M.'s technical difficulties Aug 30 '15 at 15:51
• The function is implemented in top-level code, so if you are interested you can look at its implementation using Spelunk[ReduceSumOfSquaresReps] (you need "spelunking tools" for this, see this post to get them). – MarcoB Aug 30 '15 at 18:19
• Vivid, could you explain what you would like to see in an answer? As I mentioned the first time you asked the question, you can access the actual implementation code for SumOfSquaresReps: ClearAttributes[ReduceSumOfSquaresReps, ReadProtected];??ReduceSumOfSquaresReps. What would be more credible and official than the code itself? – MarcoB Oct 16 '17 at 4:33
• @MarkoB I would like to see everything that I mentioned in the question: implementation details (if possible), perf comparison SumOfSquaresReps vs PowersRepresentations, details on other related undocumented and documented functions, etc... An overview of general methods for exploring internals of built-in functions would definitely not hurt. Thanks for interest and info so far! – VividD Oct 16 '17 at 11:36