Narcissistic decimal number: Difference between revisions
→AppleScript Functional: Minor edit to preamble.
(→{{header|AppleScript}}: Natively written version: two further optimisations, giving a 16%-18% speed improvement. Burb updated with new timings.) |
(→AppleScript Functional: Minor edit to preamble.) |
||
Line 250:
The full 7 digit search that finds the 25th number takes nearly 14 minutes on the system here (four seconds to scan the 5 digit combinations, and find the first 20, and 103 seconds to scan the six digit combinations for the first 21 narcissi).
(For comparison, equivalent code in JavaScript for Automation – the alternative idiom for osascript use on macOS – returns all 25 numbers in about 120 milliseconds).
<lang AppleScript>-- NARCISSI -------------------------------------------------------------------
|