Multiplicatively perfect numbers: Difference between revisions
Content deleted Content added
→{{header|C}}: Optimized and extended to 5 million, |
→{{header|C}}: Oops, even better :) |
||
Line 101:
=={{header|C}}==
This includes '1' as an MPN. Run time around
<syntaxhighlight lang="c">#include <stdio.h>
#include <stdbool.h>
Line 127:
if (!(n%i)) {
divs[c++] = i;
if (c >
j = n / i;
if (j != i) divs[c++] = j;
Line 137:
int main() {
int i, d, j, k, t, length, prod;
int divs[
printf("Multiplicatively perfect numbers under %d:\n", limit);
setlocale(LC_NUMERIC, "");
|