ways to make change
|
03-03-2019, 06:05 PM
(This post was last modified: 03-03-2019 08:54 PM by Albert Chan.)
Post: #4
|
|||
|
|||
RE: ways to make change
Extend with the *rare* dollar coin, lets call this a buck (B):
Re-use previous f5 helper function by adding B, 1 at a time, upto b = floor(x/100): f5 = Sum[(1 + k) * ((1+d) - 5k) * ((1+n-d) - 5k), {k, 0, h}]; f6 = Sum[f5 /. {n -> n-20k, d -> d-10k, h -> h-2k}, {k, 0, b}]; After simplication, this is final result: Code: def f6(x): >>> PNDQHB(100) # calculated as PNDQH(100) + PNDQH(0) = 292 + 1 = 293 293 >>> PNDQHB(100000) # how about 1000 dollar ? 13398445413854501L >>> PNDQHB(int(1e11)) # Billion dollar ? this match internet result! 13333333398333333445333333413833333354500000001L |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
ways to make change - Albert Chan - 03-02-2019, 05:37 PM
RE: ways to make change - Albert Chan - 03-02-2019, 06:58 PM
RE: ways to make change - Albert Chan - 03-02-2019, 10:33 PM
RE: ways to make change - Albert Chan - 03-03-2019 06:05 PM
RE: ways to make change - Albert Chan - 03-04-2019, 04:31 PM
RE: ways to make change - Albert Chan - 03-05-2019, 10:17 PM
|
User(s) browsing this thread: 1 Guest(s)