Square-free integers: Difference between revisions
Content deleted Content added
→{{header|Ruby}}: Added Ruby |
→{{header|Ruby}}: removed unneeded to_a twice |
||
Line 1,288:
end
puts (1..145).select(&:square_free?).each_slice(20)
puts
m = 10**12
puts (m..m+145).select(&:square_free?).each_slice(6)
puts
Line 1,332:
</pre>
=={{header|Sidef}}==
In Sidef, the functions ''is_square_free(n)'' and ''square_free_count(min, max)'' are built-in. However, we can very easily reimplement them in Sidef code, as fast integer factorization methods are also available in the language.
|