
Patrick B. answered 04/29/19
Math and computer tutor/teacher
This is not always possible
For example, what about (11,3) 11 as the sum of cubes:
1^3 = 1 ---> 10 remains, is not a perfect cube
2^3 = 8 ---> 3 remains and is not a perfect cube
OK O.
asked 04/24/19I need to write a function in Java which would represent a positive integer x as the sum of numbers each to the power k. For example, 25 = 3^2 + 4^2. So, once I feed 25 and 2 as arguments in it, I get (3,4) as an answer.
Patrick B. answered 04/29/19
Math and computer tutor/teacher
This is not always possible
For example, what about (11,3) 11 as the sum of cubes:
1^3 = 1 ---> 10 remains, is not a perfect cube
2^3 = 8 ---> 3 remains and is not a perfect cube
Get a free answer to a quick problem.
Most questions answered within 4 hours.
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.