Snake Arithmetic
Both functions have a conditional return based on a ternary operation, if n is any of None, False or 0 then it returns 1 as its not a bitwise operation.
I did break D(n) into maths, and I found a function that seems to generate N(b*4)b/D(b*4). My function holds (plus or minus 1) for b = 1 to 300. I've tried a range of values around my value; it is 13 digits long like it should be.
Nice to see you using the GiB! It's much underrated in my opinion.
Nice to see you using the GiB! It's much underrated in my opinion.
There is no spoon.

 Posts: 6
 Joined: Tue Nov 09, 2010 4:09 pm
 Location: Germany
I think i am at a position where i need some help.
I've transformed the recursive functions in to a iterativ one.
The first 250 values are exactly the same as in the original.
But the result i get for 1000000000000 is wrong.
My Number is 13 digits long and looks like 37...99.
I allready tried it in a range from 15 to +15 but they are all incorrect.
Can somebady give me a little hint ?
I've transformed the recursive functions in to a iterativ one.
The first 250 values are exactly the same as in the original.
But the result i get for 1000000000000 is wrong.
My Number is 13 digits long and looks like 37...99.
I allready tried it in a range from 15 to +15 but they are all incorrect.
Can somebady give me a little hint ?
The serie is not in oesis.org
I transformed D(n) and N(n) to iterative functions. But it seems to take to long:
How long did it take to calculate the result for b=1000000000000 (10*12 oder 10**12 in python )?
I transformed D(n) and N(n) to iterative functions. But it seems to take to long:
Code: Select all
$ time python snakearithmetik.py b 10 #time: 0m0.040s
$ time python snakearithmetik.py b 100 #time: 0m0.068s
$ time python snakearithmetik.py b 1000 #time: 0m14.037s
$ time python snakearithmetik.py b 10000 #time: 10h 5min 27s ... wow
Last edited by moose on Sun Jul 17, 2011 8:52 pm, edited 1 time in total.