Web services exists to perform prime factorization as follows.
These services can factorize a 30-digit number in just a few seconds.
https://sagecell.sagemath.org/
factor(717985416201895737890248682491)
https://keisan.casio.jp/exec/user/1380353934
With the trial division algorithm that I learned from you before, it took 10 days.
https://www.freebasic.net/forum/viewtop ... 5&start=30
Are there ways to do prime factorization faster in FreeBASIC using an appropriate library or something?
(Is there no need to use FreeBASIC since there are web services?)
If there is, please let me know, including specific code.
prime factorization(Solved)
-
- Posts: 238
- Joined: Apr 10, 2010 11:41
- Location: Japan
- Contact:
prime factorization(Solved)
Last edited by Makoto WATANABE on Sep 21, 2024 7:22, edited 2 times in total.
Re: prime factorization
I've looked to the code at https://keisan.casio.jp/exec/user/1380353934 and it seems to use the MathJax.js library which is really fast.
https://www.random-science-tools.com/ma ... actors.htm for example takes also very long time to factorize.
I don't know if BigInt is available for FB which can be used for long numbers.
https://www.random-science-tools.com/ma ... actors.htm for example takes also very long time to factorize.
I don't know if BigInt is available for FB which can be used for long numbers.
Re: prime factorization
there is libflint but it's a very complex library also there is libpari it's complex as well but to get a working example is not too complicated although it's not FB like but rather it's like calling the pari/gp calculator from FB
if you are interested you can get the 64-bit dll plus a rough example https://u.pcloud.link/publink/show?code ... 3VrHhYL6YX
if you are interested you can get the 64-bit dll plus a rough example https://u.pcloud.link/publink/show?code ... 3VrHhYL6YX
-
- Posts: 238
- Joined: Apr 10, 2010 11:41
- Location: Japan
- Contact:
Re: prime factorization
Dear all.
Thanks for your quick reply.
I can now do the prime factorization of a 30 digit number "offline" in less than a second!
Long live FreeBASIC!

Thanks for your quick reply.
I can now do the prime factorization of a 30 digit number "offline" in less than a second!
Long live FreeBASIC!
