Loïc Grenié on Wed, 29 Nov 2023 13:39:52 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: reasonable number size limit for working with with PARI/GP? (googol is fine, googolplex is not)


On Wed 29 Nov 2023 at 13:14, Hermann wrote:
What is a reasonable number size limit for working with with PARI/GP?
Working with 11.9million decimal digit numbers is no problem, even sub
second:
https://github.com/Hermann-SW/RSA_numbers_factored/blob/main/pari/sqrtm1.11887192_digit.largest_known_1mod4_prime.gp

hermann@7600x:~/RSA_numbers_factored/pari$ gp -q <
sqrtm1.11887192_digit.largest_known_1mod4_prime.gp
11887192-digit prime p (39488395 bits)
[M,V] = halfgcd(sqrtm1, p)
   ***   last result computed in 183 ms.
[x,y] = [V[2], M[2,1]]
   ***   last result computed in 0 ms.
sqrtm1 = lift(Mod(x, p)/y)
   ***   last result computed in 391 ms.
done, all asserts OK
hermann@7600x:~/RSA_numbers_factored/pari$


But googolplex is too much ...
https://en.wikipedia.org/wiki/Googolplex

hermann@7600x:~$ gp --version
                                             GP/PARI CALCULATOR Version
2.15.4 (released)
                                     amd64 running linux
(x86-64/GMP-6.2.1 kernel) 64-bit version
                               compiled: Aug 21 2023, gcc version 11.4.0
(Ubuntu 11.4.0-1ubuntu1~22.04)
                                                       threading engine:
single
                                           (readline v8.1 disabled,
extended help enabled)
hermann@7600x:~$ gp -q
? googol=10^100;
? googolplex=10^googol;
   ***   at top-level: googolplex=10^googol
   ***                              ^-------
   *** _^_: overflow in lg().
   ***   Break loop: type 'break' to go back to GP prompt
break>


? #digits(googol-1)
100
? ##
   ***   last result computed in 0 ms.
?

    Assuming 64bit platform, an integer n needs at least
  8*ceil(log(abs(n)+1)/64/log(2))+16 bytes of storage. What is
  a "reasonable" size depends on what you want to do with your
  integer(s).

      Best,

          Loïc