mersenneforum.org  

Go Back   mersenneforum.org > Extra Stuff > Blogorrhea > enzocreti

Reply
 
Thread Tools
Old 2018-10-11, 07:39   #1
enzocreti
 
Mar 2018

10228 Posts
Default Using julia software with extremely large numbers

I am trying to factor 2^200 with Julia software. So I tried to write factor(2^200) but the result is 0 which is clearly wrong. How does it work BigInt in Julia for handling extremely large numbers? Have I to install some extra-package?
enzocreti is offline   Reply With Quote
Old 2018-10-11, 07:48   #2
Batalov
 
Batalov's Avatar
 
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2

36×13 Posts
Default

Quote:
Originally Posted by enzocreti View Post
I am trying to factor 2^200 ...
Good luck with that!

That's an extremely large number. It has like more than sixty digits in it. It's beyond capabilities of modern computers.
Batalov is offline   Reply With Quote
Old 2018-10-11, 08:49   #3
paulunderwood
 
paulunderwood's Avatar
 
Sep 2002
Database er0rr

3,739 Posts
Default

Quote:
Originally Posted by enzocreti View Post
I am trying to factor 2^200 with Julia software. So I tried to write factor(2^200) but the result is 0 which is clearly wrong. How does it work BigInt in Julia for handling extremely large numbers? Have I to install some extra-package?
According to the documentation, it looks like you have to cast it to BigInt thusly:

Code:
factor(BigInt(2^200))
There might be another way to factor the number
paulunderwood is offline   Reply With Quote
Old 2018-10-11, 08:55   #4
ET_
Banned
 
ET_'s Avatar
 
"Luigi"
Aug 2002
Team Italia

32×5×107 Posts
Default

enzo, 2^200 = 2*2*2*2*2*2*.......*2*2*2
That is, 200 times.
So 2^200 factors like 200 times 2.
ET_ is offline   Reply With Quote
Old 2018-10-11, 12:56   #5
henryzz
Just call me Henry
 
henryzz's Avatar
 
"David"
Sep 2007
Cambridge (GMT/BST)

23·3·5·72 Posts
Default

Quote:
Originally Posted by paulunderwood View Post
According to the documentation, it looks like you have to cast it to BigInt thusly:

Code:
factor(BigInt(2^200))
There might be another way to factor the number
Would that work or would it try to calculate the 2^200 before converting to BigInt? This wouldn't work in a lot of languages.
henryzz is offline   Reply With Quote
Old 2018-10-11, 13:49   #6
danaj
 
"Dana Jacobsen"
Feb 2011
Bangkok, TH

38C16 Posts
Default

Henry is right and I have tested. big(2^200) gives 0. big(2)^200 will give you what you want. Hence factor(big(2)^200).

With Julia v0.5 and later, factor is in the Prime package, you need to run Pkg.add("Primes") if it isn't already installed. Then

Code:
julia> using Primes

julia> factor(big(2)^2000 * big(3)^1000 * 57 * 25)
2^2000 ⋅ 3^1001 ⋅ 5^2 ⋅ 19

julia> factor(big(2^2000))
0
danaj is offline   Reply With Quote
Old 2018-10-16, 09:58   #7
enzocreti
 
Mar 2018

2·5·53 Posts
Default JULIA

Quote:
Originally Posted by danaj View Post
Henry is right and I have tested. big(2^200) gives 0. big(2)^200 will give you what you want. Hence factor(big(2)^200).

With Julia v0.5 and later, factor is in the Prime package, you need to run Pkg.add("Primes") if it isn't already installed. Then

Code:
julia> using Primes

julia> factor(big(2)^2000 * big(3)^1000 * 57 * 25)
2^2000 ⋅ 3^1001 ⋅ 5^2 ⋅ 19

julia> factor(big(2^2000))
0
Ok thank you, I and Peter already managed to use it, but we realized that the software is too much slow for our purposes. If you want, you can always help us to find new ec-primes. Thanks!
enzocreti is offline   Reply With Quote
Old 2018-12-02, 17:16   #8
enzocreti
 
Mar 2018

2×5×53 Posts
Default AMAZON EC2

Quote:
Originally Posted by danaj View Post
Henry is right and I have tested. big(2^200) gives 0. big(2)^200 will give you what you want. Hence factor(big(2)^200).

With Julia v0.5 and later, factor is in the Prime package, you need to run Pkg.add("Primes") if it isn't already installed. Then

Code:
julia> using Primes

julia> factor(big(2)^2000 * big(3)^1000 * 57 * 25)
2^2000 ⋅ 3^1001 ⋅ 5^2 ⋅ 19

julia> factor(big(2^2000))
0
Do you think that with Amazon ec2 virtual machine I can reach exponent 1 million in the search of ec-primes? Primes of the form (2^k-1)*10^d+2^(k-1)-1?
enzocreti is offline   Reply With Quote
Old 2018-12-02, 17:26   #9
Batalov
 
Batalov's Avatar
 
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2

36×13 Posts
Default

yes.
just go on and rent one.
the proof of the pudding is in the eating.
Batalov is offline   Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
GNFS or SIGS in Julia? skan Factoring 0 2017-07-15 15:19
Calculating large numbers Historian Information & Answers 4 2010-03-26 19:39
extremely large numbers Mini-Geek Programming 10 2008-07-31 17:04
Julia Sets mfgoode Miscellaneous Math 2 2006-04-04 00:18
How do I get LARGE numbers Bundu Software 5 2004-08-26 01:56

All times are UTC. The time now is 04:29.


Sat Jul 17 04:29:26 UTC 2021 up 50 days, 2:16, 1 user, load averages: 2.03, 2.21, 2.29

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.