Jump to content

Self numbers: Difference between revisions

m
→‎{{header|AppleScript}}: Added a timing to the preamble.
m (→‎{{header|AppleScript}}: Added a timing to the preamble.)
Line 15:
=={{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 usingby 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>(*
557

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.