Tau number: Difference between revisions
Content deleted Content added
→{{header|Ruby}}: Improved divisibility test |
→{{header|Ruby}}: forgot about modulo |
||
Line 1,606: | Line 1,606: | ||
taus = Enumerator.new do |y| |
taus = Enumerator.new do |y| |
||
(1..).each do |n| |
(1..).each do |n| |
||
num_divisors = n.prime_division.inject(1){ |
num_divisors = n.prime_division.inject(1){|prod, n| prod *= n[1] + 1 } |
||
y << n if n |
y << n if n % num_divisors == 0 |
||
end |
end |
||
end |
end |