hacker.org Forum Index
RegisterSearchFAQMemberlistUsergroupsLog in
Snake Arithmetic
Goto page Previous  1, 2, 3
 
Reply to topic    hacker.org Forum Index » Challenges View previous topic
View next topic
Snake Arithmetic
Author Message
Besere



Joined: 12 Mar 2011
Posts: 12

Post Reply with quote
I got 37xxxxxxxxx54 but it is incorrect. Any hints on what I might have did wrong?
Wed Mar 14, 2012 9:07 am View user's profile Send private message
honze



Joined: 03 Nov 2008
Posts: 6
Location: Munich, Germany

Post Reply with quote
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 #%&$§.
Wed Mar 28, 2012 12:23 pm View user's profile Send private message Visit poster's website ICQ Number
Hippo



Joined: 01 Feb 2014
Posts: 339
Location: Praha 5

Post Reply with quote
For those who donīt like guessing ... the correct answer is smaller by one than the answer the challenge accepts.
Mon May 12, 2014 4:23 pm View user's profile Send private message
meis



Joined: 28 Aug 2012
Posts: 16
Location: Italy

Post Reply with quote
I transformed D(n) in something not-recursive. Am I on the right path? Can I do the same with N(n)? I can't find a pattern...
Fri Jun 13, 2014 5:56 pm View user's profile Send private message
Hippo



Joined: 01 Feb 2014
Posts: 339
Location: Praha 5

Post Reply with quote
meis wrote:
I transformed D(n) in something not-recursive. Am I on the right path? Can I do the same with N(n)? I can't find a pattern...


My path ... used just pen and paper.
Tue Jun 17, 2014 10:50 pm View user's profile Send private message
5el



Joined: 18 Jul 2012
Posts: 4

Post Reply with quote
Hippo wrote:
For those who donīt like guessing ... the correct answer is smaller by one than the answer the challenge accepts.

If I round my result correctly I'm getting exactly the result accepted by the challenge.
Wed Aug 31, 2016 7:21 am View user's profile Send private message
Hippo



Joined: 01 Feb 2014
Posts: 339
Location: Praha 5

Post Reply with quote
5el wrote:
Hippo wrote:
For those who donīt like guessing ... the correct answer is smaller by one than the answer the challenge accepts.

If I round my result correctly I'm getting exactly the result accepted by the challenge.


Yes, my fault, the challenge is OK.
Wed Aug 31, 2016 8:12 pm View user's profile Send private message
peterisp



Joined: 11 Dec 2016
Posts: 1

Post Reply with quote
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?
Wed May 24, 2017 4:32 pm View user's profile Send private message
Hippo



Joined: 01 Feb 2014
Posts: 339
Location: Praha 5

Post Reply with quote
I did it the way you describe. So recheck the reasoning for the formula and as well the transformation to the answer ... number of digits used ... .
Thu May 25, 2017 5:42 pm View user's profile Send private message
meis



Joined: 28 Aug 2012
Posts: 16
Location: Italy

Post Reply with quote
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)
Thu Feb 10, 2022 2:53 pm View user's profile Send private message
tehron



Joined: 30 Jun 2009
Posts: 4

Post Reply with quote
Let me just say: I feel with you.

Hope we will solve it soon! :)
Sat May 21, 2022 5:40 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    hacker.org Forum Index » Challenges All times are GMT
Goto page Previous  1, 2, 3
Page 3 of 3

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.