Practical numbers: Difference between revisions

m
(→‎{{header|RPL}}: typo + benchmark for the Srinivasan-Stewart-Sierpinsky characterization method)
 
Line 1,617:
 
====Using Srinivasan-Stewart-Sierpinsky characterization====
From [https://en.wikipedia.org/wiki/Practical_number#Characterization_of_practical_numbers the Wikipedia article]. FastIt's very fast and noneeds only to store the prime decomposition of specialthe memorytested requirementsnumber.
« '''CASE'''
DUP LN 2 LN / FP NOT '''THEN''' SIGN '''END''' <span style="color:grey">@ powers of two are practical</span>
Line 1,648:
1: 0
</pre>
Non-practicality of 66666 is established in 0.57 secseconds on an HP-50 handheld calculator; testing 222222 or 9876543210 needs 1.5 seconds. Because of the algorithm's efficiency, even antique calculators from the 1970s could implement it, with an acceptable execution time.
 
=={{header|Rust}}==
1,151

edits