Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hachreak/factorize-numbers
Implementation of three different algorithms to factorize prime numbers: my algorithm, Pollard-Rho algorithm, Brent algorithm (Pollard-Rho optimization).
https://github.com/hachreak/factorize-numbers
Last synced: about 7 hours ago
JSON representation
Implementation of three different algorithms to factorize prime numbers: my algorithm, Pollard-Rho algorithm, Brent algorithm (Pollard-Rho optimization).
- Host: GitHub
- URL: https://github.com/hachreak/factorize-numbers
- Owner: hachreak
- License: other
- Created: 2014-06-07T01:07:20.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-03-08T23:00:58.000Z (over 9 years ago)
- Last Synced: 2023-03-11T12:47:52.398Z (over 1 year ago)
- Language: Perl
- Homepage:
- Size: 160 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
- License: LICENSE
Awesome Lists containing this project
README
/**
* Copyright (C) 2014 Leonardo Rossi
*
* This source code is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This source code is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this source code; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/Implementation of three different algorithms to factorize prime numbers:
- first algorithm
- Pollard-Rho algorithm
- Brent algorithm (Pollard-Rho optimization)
The web interface is used to contact the .cgi and ask to factorize number.
Enjoy it... ;)Note: First algorithm is quick if the number of digits is not high.
Otherwise, the other two algorithms should be faster, because are based on Floyd's
cycle-finding algorithm and on the observation that (as in the birthday problem)
two numbers x and y are congruent modulo p with probability 0.5 after
1.177(sqrt{p}) numbers have been randomly chosen.