### Author Topic: An astronomical number  (Read 5934 times)

#### jack

• Member
• Posts: 223
##### Re: An astronomical number
« Reply #15 on: January 31, 2022, 02:35:57 AM »
hello daydreamer
I have not tried it with Raymond's sqrt but there are 5 10000-digit Fibonacci numbers for n=47847 to 47851 so you might try those or you may try 47811
« Last Edit: January 31, 2022, 04:01:06 AM by jack »

#### raymond

• Member
• Posts: 318
##### Re: An astronomical number
« Reply #16 on: January 31, 2022, 05:14:48 AM »
How far can you go with help of raymonds 9999 digits sqrt program ?

You would be limited to a bit less than half your available RAM in most cases.
Whenever you assume something, you risk being wrong half the time.
http://www.ray.masmcode.com/

#### daydreamer

• Member
• Posts: 2307
• my kind of REAL10 Blonde
##### Re: An astronomical number
« Reply #17 on: January 31, 2022, 11:13:20 PM »
How far can you go with help of raymonds 9999 digits sqrt program ?

You would be limited to a bit less than half your available RAM in most cases.
http://masm32.com/board/index.php?topic=9801.0

I am trying a multithread solution,when I found out printing is much slower than only fibonnaci calculation

my none asm creations
http://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

#### NoCforMe

• Member
• Posts: 1043
##### Re: An astronomical number
« Reply #18 on: February 01, 2022, 06:42:06 PM »
Most of this stuff is over my head. However, I have noticed something which I'm sure you, Raymond, have noticed as well: that all of the F[n] #s that are the first [power-of-ten]th ones start with 47. Weird, eh? Is this the new 42?

#### raymond

• Member
• Posts: 318
##### Re: An astronomical number
« Reply #19 on: February 02, 2022, 05:54:43 AM »
http://masm32.com/board/index.php?topic=9801.0[/quote]

If you need access to external memory to supplement RAM, an SSD would definitely be a lot faster than an HHD. However, it certainly would not be as fast as using only RAM.
Whenever you assume something, you risk being wrong half the time.
http://www.ray.masmcode.com/

#### raymond

• Member
• Posts: 318
##### Re: An astronomical number
« Reply #20 on: February 02, 2022, 06:44:50 AM »
Most of this stuff is over my head. However, I have noticed something which I'm sure you, Raymond, have noticed as well: that all of the F[n] #s that are the first [power-of-ten]th ones start with 47. Weird, eh? Is this the new 42?

Yes, I did. I had noticed that the F[n] of each next multiple seemed to be a near perfect [10*[Fn-1 + 2]] +/- x}. That's how I had arrived at my estimated F106 value (which I got lucky to get dead on).

You will notice that the F107 reported a little earlier by Jack follows the exact same pattern. However, I have not been able to understand his reported {first 10 digits 8490335471 and the last 10 digits 8041866146} for that Fn; one of then should be starting with a "1", unless the first ten is given in little-endian format; even then, the 2nd most significant digit would be expected to be a "0".
Whenever you assume something, you risk being wrong half the time.
http://www.ray.masmcode.com/

#### jack

• Member
• Posts: 223
##### Re: An astronomical number
« Reply #21 on: February 02, 2022, 07:30:14 AM »
Raymond, there are 5 10-million digits Fibonacci numbers starting with n=47849717 .. 47849721, for whatever reason I didn't choose the first but the last

#### daydreamer

• Member
• Posts: 2307
• my kind of REAL10 Blonde
##### Re: An astronomical number
« Reply #22 on: February 02, 2022, 08:07:54 PM »
http://masm32.com/board/index.php?topic=9801.0

If you need access to external memory to supplement RAM, an SSD would definitely be a lot faster than an HHD. However, it certainly would not be as fast as using only RAM.
[/quote]
streaming would be something new to try
with slowest HHD,could do the crpg approach,start play saturday many hours and gain first few lvls and sunday keep going to midlvls loading save file

few mb lvl3 cache probably makes it even faster 1million digits
is performance following cache speed: few digits fit in lvl1 cache,several digits that need lvl2 cache after that lvl3 cache after that RAM speed?

after all without terabyte HD's, how could I otherwise reach "An astronomical number"?
my none asm creations
http://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

#### jack

• Member
• Posts: 223
##### Re: An astronomical number
« Reply #23 on: February 02, 2022, 10:52:32 PM »
speaking of astronomical numbers see the draft-task at Rosetta-code https://rosettacode.org/wiki/Fibonacci_matrix-exponentiation
Quote
Only display the first 20 decimal digits   and   the last 20 decimal digits of each Fibonacci number.

Extra

Generate Fibonacci(2^16 ), Fibonacci(2^32) and Fibonacci(2^64) using the same method or another one.
some of the participants give the result for Fibonacci(2^32) but no one gives the result for Fibonacci(2^64)
the Fibonacci approximation is the nearest integer of ( ((1+sqrt(5))/2)^n )/sqrt(5) so (log10((1+sqrt(5))/2)*n)-log10(sqrt(5)) = 3855141514259838963.0482789140108138539478 and 10^.0482789140108138539478 = 1.11758075369295284246090548
so Fibonacci(2^64) ~ 1.11758075369295284246090548 * 10^3855141514259838963
it's easy enough to get the first 20 digits but I don't see how anyone could get the last 20 digits

#### mikeburr

• Member
• Posts: 186
##### Re: An astronomical number
« Reply #24 on: February 02, 2022, 11:12:23 PM »
there are 732 ways of making 22 with the numbers 1 to 9 .. this wd not represent all  the combinations numerical combinations [infinite possible with real numbers due to the inclusion of zero - which adds nothing to the total ]
regards  mike b

#### jack

• Member
• Posts: 223
##### Re: An astronomical number
« Reply #25 on: February 03, 2022, 01:40:39 AM »

#### daydreamer

• Member
• Posts: 2307
• my kind of REAL10 Blonde
##### Re: An astronomical number
« Reply #26 on: February 05, 2022, 11:20:34 AM »
Wonder what's correct f(0ffffffffffffffffh)?
my none asm creations
http://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

#### jack

• Member
• Posts: 223
##### Re: An astronomical number
« Reply #27 on: February 07, 2022, 12:06:59 AM »
hi daydreamer
I am guessing that you want the hexadecimal of 2^64 ?
0ffffffffffffffffh = (2^64)-1
010000000000000000h = 2^64 , obviously it's to large for a 64-bit register

#### daydreamer

• Member
• Posts: 2307
• my kind of REAL10 Blonde
##### Re: An astronomical number
« Reply #28 on: February 08, 2022, 04:01:09 AM »
dont know if its correct
lowest 20 digits reported after f(4gig)
unrolled twice so final result are
450620520661802223330 or
039623735538208076347
final time :0h 5m 9s f0
my none asm creations
http://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

#### raymond

• Member
• Posts: 318
##### Re: An astronomical number
« Reply #29 on: February 11, 2022, 07:10:26 AM »
speaking of astronomical numbers see the draft-task at Rosetta-code https://rosettacode.org/wiki/Fibonacci_matrix-exponentiation

I wish I had one of the working programs using matrix-exponentiation so I could figure out (by disassembling it) how they can achieve the precision required to generate all those Fibonacci numbers within the "short" times reported. I've checked the last 12 digits of the reported F10000 and they were the same as those that I generate.

I tried using the formulas reported earlier by Jack to get the 2k and 2k+1 F numbers, BUT multiplications using BCDs is a slow process, actually slower than generating each next Fib number by the usual serial addition of F(k-1) with F(k-2).

I must admit that those formulas work perfectly; but it was a nightmare writing and debugging the algo to use them with BCDs. Maybe I'm getting too old for this.
Whenever you assume something, you risk being wrong half the time.
http://www.ray.masmcode.com/