Magnanimous numbers: Difference between revisions
Content deleted Content added
→{{header|Ruby}}: prime module required |
|||
Line 1,143:
=={{header|Ruby}}==
{{trans|Sidef}}
<lang ruby>
magnanimouses = Enumerator.new do |y|
(0..).each {|n| y << n if (1..n.digits.size-1).all? {|k| n.divmod(10**k).sum.prime?} }
end
|