Jump to content

Distinct power numbers: Difference between revisions

(add OCaml)
Line 823:
Found 15 numbers
done...
</pre>
 
=={{header|Ruby}}==
<syntaxhighlight lang="ruby">a = (2..5).to_a
p a.product(a).map{_1 ** _2}.sort.uniq</syntaxhighlight>
{{out}}
<pre>
[4, 8, 9, 16, 25, 27, 32, 64, 81, 125, 243, 256, 625, 1024, 3125]
</pre>
 
1,149

edits

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