http://projecteuler.net/problem=29 全列挙するだけ {{{#!highlight ruby #!/usr/bin/env ruby a = (2..100).collect do |a| (2..100).collect do |b| a ** b end end p a.flatten.sort.uniq.size }}}