Perfect Number Generator

Finds even perfect numbers [ppN(:,3)] for each relevant prime <= P.
517 descargas
Actualizado 12 ene 2010

Ver licencia

It calculates perfect even #'s with 2^(p-1)*(2^p - 1) where p and (2^p - 1)
%are prime. A subsequent run yields a faster run-time. The code is fully
%vectorized and hence cleaner than previous versions of the function.
%NB: if (2^p - 1) is a Mersenne prime then a perfect number has been found.
%
%SYNTAX: >> perf_finalv4(P) % where P is an integer scalar in
%useful inclusive range [2..31].
%i.e. run showing first 8 perfect numbers...
%>> p = perf_finalv4(31);
%>> [p(:,3)]
%
% ans =
%
% 6
% 28
% 496
% 8128
% 33550336
% 8589869056
% 137438691328
% 2.30584300813995e+018

Citar como

Bruce Raine (2024). Perfect Number Generator (https://www.mathworks.com/matlabcentral/fileexchange/26314-perfect-number-generator), MATLAB Central File Exchange. Recuperado .

Compatibilidad con la versión de MATLAB
Se creó con R2009b
Compatible con cualquier versión
Compatibilidad con las plataformas
Windows macOS Linux
Categorías
Más información sobre Discrete Math en Help Center y MATLAB Answers.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Versión Publicado Notas de la versión
1.3.0.0

Corrected comments in function header i.e.
%2^43,112,608 × (2^43,112,609 - 1)
and also spelling typo. NB: neither change affects the function's performance.

1.0.0.0