Snake Arithmetic
I used several implementations in different languages to calculate and compare.
The good thing: I get consistent results with small error rates. (Java same result as Python)
The bad thing: The last three digits are varying.
At some point (~85000000 iterations) the value of the answer does not change anymore.
I get there quite fast.
How do I check, whether my sum is "correct"?
I could bruteforce the last three digits, but that is #%&$§.
The good thing: I get consistent results with small error rates. (Java same result as Python)
The bad thing: The last three digits are varying.
At some point (~85000000 iterations) the value of the answer does not change anymore.
I get there quite fast.
How do I check, whether my sum is "correct"?
I could bruteforce the last three digits, but that is #%&$§.
I'm a bit confused here. I have an analytic solution to what exactly N(x)/D(x) converges at infinity (starting with 0.7), which matches what I get if I run an optimized version of the code up to some 100000 iterations. At 1000000000000 iterations it should be converged to all the required significant digits - but still if I calculate that number and multiply by 1000000000000, it's not getting accepted as a correct answer, including some +- values that might be (but shouldn't be) affected by rounding.
Am I missing something here?
Am I missing something here?
Alright, before I go on with my comment here, it's best I do a little prologue.
This challenge is my nemesis.
I love math, always have, and I started tackling this challenge for the first time when I was around 16/17 years old (more or less when I created my account here). From there on I started doing challenges occasionally, and every 1 or 2 years I come back here, to see if I have improved in some sense (usually I manage to do 2/3 challenges each time). Every time I try to do this one, and every time I come closer and closer, without actually managing to.
It angers me, because I KNOW it's easy, I KNOW the solution is before my eyes, but I cannot see it.
This time, after almost ten years from the first time I tackled this (and around 30/40 hours of fiddling with numbers and formulas), I give up. And by give up, I mean that I ask for some tips on this forum.
I managed to come up with a decent formula for N(x)/D(x), but it still is recursive. I translated it into a series, hoping I didn't do any math error along the way.
Now since this series still loops x/2 times, I need to unravel it. It seems the last step but really, I can't find the way to do it.
I'm not sayinmg too much to not spoil for others, but how can I do this last step? Should it be obvious? Have I made a mistake in rewriting the formula into a series? (although the result seems to work correctly for me for low numbers)
This challenge is my nemesis.
I love math, always have, and I started tackling this challenge for the first time when I was around 16/17 years old (more or less when I created my account here). From there on I started doing challenges occasionally, and every 1 or 2 years I come back here, to see if I have improved in some sense (usually I manage to do 2/3 challenges each time). Every time I try to do this one, and every time I come closer and closer, without actually managing to.
It angers me, because I KNOW it's easy, I KNOW the solution is before my eyes, but I cannot see it.
This time, after almost ten years from the first time I tackled this (and around 30/40 hours of fiddling with numbers and formulas), I give up. And by give up, I mean that I ask for some tips on this forum.
I managed to come up with a decent formula for N(x)/D(x), but it still is recursive. I translated it into a series, hoping I didn't do any math error along the way.
Now since this series still loops x/2 times, I need to unravel it. It seems the last step but really, I can't find the way to do it.
I'm not sayinmg too much to not spoil for others, but how can I do this last step? Should it be obvious? Have I made a mistake in rewriting the formula into a series? (although the result seems to work correctly for me for low numbers)