Munchausen numbers: Difference between revisions

m
→‎{{header|REXX}}: used consistent spelling of Münchhausen.
(add Pure language solution)
m (→‎{{header|REXX}}: used consistent spelling of Münchhausen.)
Line 994:
 
For the high limit of   '''5,000''',   optimization isn't needed.   But for much higher limits, optimization becomes significant.
<lang rexx>/*REXX program finds and displays MunchhausenMünchhausen numbers from one to a specified number (Z)*/
@.=0; do i=1 for 9; @.i=i**i; end /*precompute powers for non-zero digits*/
parse arg z . /*obtain optional argument from the CL.*/
Line 1,015:
===version 3===
It is about 3 times faster than version 1.
<lang rexx>/*REXX program finds and displays MunchhausenMünchhausen numbers from one to a specified number (Z)*/
@.=0; do i=1 for 9; @.i=i**i; end /*precompute powers for non-zero digits*/
parse arg z . /*obtain optional argument from the CL.*/