Numbers which are the cube roots of the product of their proper divisors: Difference between revisions
Numbers which are the cube roots of the product of their proper divisors (view source)
Revision as of 12:23, 13 January 2023
, 1 year ago→{{header|AppleScript}}: Tidied and added observation about the numbers' fourth powers.
(Added AppleScript.) |
m (→{{header|AppleScript}}: Tidied and added observation about the numbers' fourth powers.) |
||
Line 105:
=={{header|AppleScript}}==
<syntaxhighlight lang="applescript">on properDivisors(n)
set output to {}
Line 137:
on task()
set output to {"First 50 numbers whose cubes are the products of their proper divisors
"(and of course whose fourth powers are the products of ALL their positive divisors):"}
set n to 1
set
repeat 49 times▼
▲ repeat
set n to n + 1
set
end
set end of first50 to text -5 thru
set end of output to "50,000th: " & text -6 thru -1 of (" " & n)▼
repeat with i from 1 to 41 by
set end of output to join(first50's items i
end repeat
set |count| to 50
repeat with target in {500, 5000, 50000}
repeat with |count| from (|count| + 1) to target
repeat until ((count
end
▲ set end of output to text -6 thru -1 of (pad &
▲ end if
▲ end if
end repeat
Line 170 ⟶ 169:
{{output}}
<syntaxhighlight lang="applescript">"First 50 numbers whose cubes are the products of their proper divisors
(and of course whose fourth powers are the products of ALL their positive divisors):
1 24 30 40 42 54 56 66 70 78
88 102 104 105 110 114 128 130 135 136
Line 177:
255 258 266 273 282 285 286 290 296 297
500th: 2526
=={{header|BASIC}}==
|