PowersRepresentations[n,k,p]
gives the distinct representations of the integer n as a sum of k non-negative p
integer powers.
PowersRepresentations
PowersRepresentations[n,k,p]
gives the distinct representations of the integer n as a sum of k non-negative p
integer powers.
Details
- PowersRepresentations[n,k,p] returns lists of integers
such that
.
Examples
open all close allBasic Examples (1)
Scope (2)
Representation of relatively large numbers as the sum of two squares:
PowersRepresentations[489886592769624989886788, 2, 2]PowersRepresentations[1729, 2, 3]PowersRepresentations[87539319, 2, 3]PowersRepresentations[6963472309248, 2, 3]PowersRepresentations[48988659276962496, 2, 3]Properties & Relations (2)
Use FindInstance to find a solution instance:
Sort[{a, b, c} /. #] & /@ FindInstance[a ^ 2 + b ^ 2 + c ^ 2 == 102, {a, b, c}, Integers]PowersRepresentations[102, 3, 2]PowersRepresentations gives ordered partitions of fixed length:
Select[PowersRepresentations[7, 3, 1], FreeQ[#, 0] &]Sort /@ Select[IntegerPartitions[7], Length[#] == 3 &]Tech Notes
Related Guides
History
Text
Wolfram Research (2007), PowersRepresentations, Wolfram Language function, https://reference.wolfram.com/language/ref/PowersRepresentations.html.
CMS
Wolfram Language. 2007. "PowersRepresentations." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/PowersRepresentations.html.
APA
Wolfram Language. (2007). PowersRepresentations. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/PowersRepresentations.html
BibTeX
@misc{reference.wolfram_2026_powersrepresentations, author="Wolfram Research", title="{PowersRepresentations}", year="2007", howpublished="\url{https://reference.wolfram.com/language/ref/PowersRepresentations.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_powersrepresentations, organization={Wolfram Research}, title={PowersRepresentations}, year={2007}, url={https://reference.wolfram.com/language/ref/PowersRepresentations.html}, note=[Accessed: 12-June-2026]}