All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Numbers
Quintic Minimum (Posted on 2023-04-13) Difficulty: 3 of 5
722 can be expressed as the sum of n positive perfect fifth powers. What is the minimum value for n?

See The Solution Submitted by K Sengupta    
Rating: 5.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Some Thoughts Better, not necessarily best answer | Comment 2 of 4 |
Here is a solution with 8 fifth powers:
[5206, 2436, 432, 152, 69, 16, 7, 6, 5]

I'm not sure if this algorithm might miss a better solution

goal = 7**22

def strip(guess,n):
    """ start with first number, successive subtraction of guess^5 and
    count the number of 5th powers to sum to goal   """
    count = 0
    runningsum = guess**5
    values = [guess]
    diff = goal - runningsum
    while diff > 0:
        x = int(diff ** .2)
        x5 = x**5
        values.append(x)
        runningsum += x5
        diff = goal - runningsum
        count += 1
    return [count, values]

bestcount = 1000
bestvals = []
for n in range(5229,2,-1):
    info = strip(n,goal)
    thiscount = info[0]
    thesevals = info[1]
    if thiscount < bestcount:
        bestcount = thiscount
        bestvals = thesevals

print(bestcount)
print(bestvals)

  Posted by Larry on 2023-04-13 12:34:36
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (4)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (16)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information