Thank you for your contributions to this free encyclopedia. If you decide that you need help, check out Getting Help below, ask at the help desk, or place {{Help me}} on your talk page and ask your question there. Please remember to sign your name on talk pages by clicking or by typing four tildes (~~~~); this will automatically produce your username and the date. Also, please do your best to always fill in the edit summary field. Below are some useful links to help you get started. Happy editing! Ahunt (talk) 11:52, 15 March 2021 (UTC)[reply]
Are you sure about that? I used the recurrence relation to code a recursive function, and I got a different answer to p(100) than the one on the wiki page. But when I changed the bounds, it gave me the correct answer. Krypton Liverwurst (talk) 19:10, 3 September 2023 (UTC)[reply]
I'm sure about the bounds, their derivation is pretty simple. I guess there's a rounding error in your code, possibly in the square root function – some math libraries might produce e.g. 48.99999... for sqrt(2401). I just wrote this bit of code which uses the correct bounds, and it produces the correct results on my machine. — Chrisahn (talk) 21:14, 3 September 2023 (UTC)[reply]
Oops! My bad! :) I think you're right.. In my version of the code, the variable `s` was divided by 6. Then `kmin` and `kmax` were `1/6-s` and `1/6+s` respectively. That didn't work, so I 'fixed' it by changing `kmin` to `-(1/6+s)`. I was convinced that must be right, because I even used that code to find the number from this puzzle here (https://projecteuler.net/problem=78). However, it seems that distributing the fraction was the bug in my code: https://godbolt.org/z/Gva6KhKxY... :/ Krypton Liverwurst (talk) 07:28, 4 September 2023 (UTC)[reply]