Sign in to follow this  
Followers 0

coin change problem

3 posts in this topic

Posted · Report post

so plasmids problem got me to thinking; given a set of integers, smallest being 1, can you always find the optimal change (fewest number of coins)?

consider the following set.

1 4 9 25 49 121 169...

where you have every prime number squared.

try finding the optimal change for...

288 and

1368 and

9408

0

Share this post


Link to post
Share on other sites

Posted · Report post

Here's a couple of answers for each one. They each use the optimal change of 7 coins.

288:

121 121 25 9 4 4 4

169 49 49 9 4 4 4

1368:

961 361 25 9 4 4 4

529 529 289 9 4 4 4

9408:

6889 2209 289 9 4 4 4

5329 2209 1849 9 4 4 4

1

Share this post


Link to post
Share on other sites

Posted · Report post

nicely done super, somehow i had a feeling you would be the one to solve this :-)

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.