Haha James, thanks for the compliment! Actually this problem and solution was inspired by an interesting math question posed by (and solved by) a coworker. I don't want to give away the answer to people who haven't solved it yet, so I won't explain how it works. But I agree that it's quite a nifty solution.
Oh, and the coolest thing about it is that it can solve for every coefficient with only two calls to the function (assuming you can handle big enough integers)
4 Comments