Jump to content

Numbers which are the cube roots of the product of their proper divisors: Difference between revisions

(Added C)
Line 1,153:
 
Fifty thousandth: 223,735</pre>
=={{header|Ruby}}==
<syntaxhighlight lang="ruby" line>require 'prime'
 
def tau(n) = n.prime_division.inject(1){|res, (d, exp)| res *= exp+1}
a111398 = [1].chain (1..).lazy.select{|n| tau(n) == 8}
 
puts "The first 50 numbers which are the cube roots of the products of their proper divisors:"
p a111398.first(50)
[500, 5000, 50000].each{|n| puts "#{n}th: #{a111398.drop(n-1).next}" }
</syntaxhighlight>
{{out}}
<pre>The first 50 numbers which are the cube roots of the products of their proper divisors:
[1, 24, 30, 40, 42, 54, 56, 66, 70, 78, 88, 102, 104, 105, 110, 114, 128, 130, 135, 136, 138, 152, 154, 165, 170, 174, 182, 184, 186, 189, 190, 195, 222, 230, 231, 232, 238, 246, 248, 250, 255, 258, 266, 273, 282, 285, 286, 290, 296, 297]
500th: 2526
5000th: 23118
50000th: 223735
</pre>
 
=={{header|Wren}}==
1,149

edits

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