a thoughtful web.
Good ideas and conversation. No ads, no tracking.   Login or Take a Tour!
comment by tehstone
tehstone  ·  3292 days ago  ·  link  ·    ·  parent  ·  post: A nice problem from SICP

A couple of weeks ago someone on /r/learnpython asked for help on a recursive method to generate the number of ways to count to n when at any point you could step up by 1 or 2. That was a fairly easy problem to solve and this seems to be nothing more than an advanced version of the same question. N is fixed at 100 and we have steps of (1, 5, 10, 25, 50). The major difference is that when stepping by only 1 or 2 the number of solutions is not limited by duplicates (ie for n=5 you can have (2, 1, 1, 1) and (1, 2, 1, 1)) whereas in this problem the analogous solutions would be considered duplicates.

I'll see if I can come up with a solution.