Self numbers: Difference between revisions
Content added Content deleted
m (→{{header|AppleScript}}: Added a timing to the preamble.) |
|||
Line 15: | Line 15: | ||
=={{header|AppleScript}}== |
=={{header|AppleScript}}== |
||
I couldn't follow the math in the Wikipedia entry, nor the discussion and code here so far. But an initial expedient of generating a list of all the integers from 1 to just over ten times the required number of results and then deleting those that ''could'' be derived |
I couldn't follow the math in the Wikipedia entry, nor the discussion and code here so far. But an initial expedient of generating a list of all the integers from 1 to just over ten times the required number of results and then deleting those that ''could'' be derived by the described method revealed the sequencing pattern on which the code below is based. On the test machine, it completes all three of the tests at the bottom in a total of around a millisecond. |
||
<lang applescript>(* |
<lang applescript>(* |