myfactor
Version 1.0.0.0 (2.24 KB) by
John T. McCarthy
This function finds the factors of very large numbers (up to 10^14)
To find the prime factors of any number up to 2^32 (about 4.3*10^9), you can use MATLAB's built-in function factor.m
For integers greater than 2^32, try this program, which guarantees a result up to 10^14, thus extending the domain of inputs 23,000-fold.
(This file is an adaptation of MATLAB's function primes.m)
Example:
myfactor(2^32+1)
ans = [1 641 6700417]
Cite As
John T. McCarthy (2026). myfactor (https://uk.mathworks.com/matlabcentral/fileexchange/20059-myfactor), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2006a
Compatible with any release
Platform Compatibility
Windows macOS LinuxCategories
- MATLAB > Mathematics > Elementary Math >
Find more on Elementary Math in Help Center and MATLAB Answers
Tags
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
| Version | Published | Release Notes | |
|---|---|---|---|
| 1.0.0.0 | Attempt to improve presentation, following John D'Errico's review. |
