Anonymous user
Self numbers: Difference between revisions
m
→first 50 self numbers: added/changed whitespace and comments.
m (→{{header|Phix}}: ditto, removed unnecessary return) |
m (→first 50 self numbers: added/changed whitespace and comments.) |
||
Line 997:
parse arg n . /*obtain optional argument from the CL.*/
if n=='' | n=="," then n= 50 /*Not specified? Then use the default.*/
@.=
do j=1 for n*10 /*scan through ten times the #s wanted.*/
$= j /*1st part of sum is the number itself.*/
Line 1,005:
@.$= /*mark J as not being a self number. */
end /*j*/
list= 1 /*initialize the list to the
#= # + 1;
▲ end /*i*/
say 'the first ' n " self numbers are:"
say list /*display list of self numbers ──►term.*/
exit 0 /*stick a fork in it, we're all done. */</lang>
|