Anaprimes: Difference between revisions
Content added Content deleted
(→{{header|Ruby}}: Add Ruby) |
|||
Line 940: | Line 940: | ||
upto = 100_000_000 |
upto = 100_000_000 |
||
h = Hash.new {|hash, key| hash[key] = []} |
h = Hash.new {|hash, key| hash[key] = []} |
||
Prime.each(upto) |
Prime.each(upto) {|pr| h[pr.digits.sort] << pr } |
||
h[pr.digits.sort] << pr |
|||
end |
|||
(3..(upto.digits.size-1)).each do |num_digits| |
(3..(upto.digits.size-1)).each do |num_digits| |