Distinct power numbers: Difference between revisions
Content added Content deleted
(→{{header|Raku}}: Filter duplicates (that I missed originally [Thanks Thundergnat!]) more efficiently; they are adjacent after sorting.) |
(Added AppleScript.) |
||
Line 13: | Line 13: | ||
{{out}} |
{{out}} |
||
<pre>4 8 9 16 25 27 32 64 81 125 243 256 625 1024 3125</pre> |
<pre>4 8 9 16 25 27 32 64 81 125 243 256 625 1024 3125</pre> |
||
=={{header|AppleScript}}== |
|||
<lang applescript>on task() |
|||
script o |
|||
property output : {} |
|||
end script |
|||
repeat (5 ^ 5) times |
|||
set end of o's output to missing value |
|||
end repeat |
|||
repeat with a from 2 to 5 |
|||
repeat with b from 2 to 5 |
|||
tell (a ^ b as integer) to set item it of o's output to it |
|||
tell (b ^ a as integer) to set item it of o's output to it |
|||
end repeat |
|||
end repeat |
|||
return o's output's integers |
|||
end task |
|||
task()</lang> |
|||
{{output}} |
|||
<lang applescript>{4, 8, 9, 16, 25, 27, 32, 64, 81, 125, 243, 256, 625, 1024, 3125}</lang> |
|||
=={{header|Go}}== |
=={{header|Go}}== |
||
{{trans|Wren}} |
{{trans|Wren}} |