Anti-primes: Difference between revisions

m
→‎{{header|Ruby}}: copy-paste error removed
m (→‎{{header|Ruby}}: copy-paste error removed)
Line 3,843:
=={{header|Ruby}}==
<syntaxhighlight lang="ruby">require 'prime'
 
{{works with|Halcyon Calc|4.2.7}}
def num_divisors(n)
n.prime_division.inject(1){|prod, (_p,n)| prod *= (n + 1) }
1,149

edits