Proper divisors: Difference between revisions
Content added Content deleted
Drkameleon (talk | contribs) (Undo revision 324745 by Drkameleon (talk)) |
m (→{{header|AppleScript}}: Idiomatic: Minor edit in handler.) |
||
Line 650: | Line 650: | ||
if (n > 1) then |
if (n > 1) then |
||
set sqrt to n ^ 0.5 |
set sqrt to n ^ 0.5 |
||
set limit to sqrt div 1 |
|||
if (limit = sqrt) then |
|||
set |
set end of output to limit |
||
set limit to limit - 1 |
|||
end if |
end if |
||
repeat with i from |
repeat with i from limit to 2 by -1 |
||
if (n mod i is 0) then |
if (n mod i is 0) then |
||
set beginning of output to i |
set beginning of output to i |