Magnanimous numbers: Difference between revisions

Content added Content deleted
m (→‎{{header|REXX}}: added 1st/last digit parity test, optimized the MAGNA function.)
Line 428: Line 428:


=={{header|REXX}}==
=={{header|REXX}}==
The majority of the time consumed was in generated a list (sparse array) of suitable primes.
The majority of the time consumed was in generating a list (sparse array) of suitable primes.
<br>The '''genP''' subroutine could use a lot of optimization if wanted.
<br>The '''genP''' subroutine could use a lot of optimization if wanted.
<br>The '''magna''' function (magnanimous) was quite simple to code and pretty fast, it includes the 1<sup>st</sup> and last digit parity test.
<br>The '''magna''' function (magnanimous) was quite simple to code and pretty fast, it includes the 1<sup>st</sup> and last digit parity test.
Line 493: Line 493:
────────────────────────────────────────────── 391 ──► 400 magnanimous numbers ───────────────────────────────────────────────
────────────────────────────────────────────── 391 ──► 400 magnanimous numbers ───────────────────────────────────────────────
486685 488489 515116 533176 551558 559952 595592 595598 600881 602081
486685 488489 515116 533176 551558 559952 595592 595598 600881 602081
<pre>
</pre>