Sha256: 0ef1d30b7929152a146315fa7cc54cfcb4a96d95379daa30055a250a8bfbf5b1
Contents?: true
Size: 261 Bytes
Versions: 31
Compression:
Stored size: 261 Bytes
Contents
MAX = 1000 class Fixnum def prime? ('1' * self) !~ /^1?$|^(11+?)\1+$/ end end class PrimeChecker def is_prime? number number.prime? end end prime_checker = PrimeChecker.new (10_000...(10_000+MAX)).each do |n| prime_checker.is_prime? n end
Version data entries
31 entries across 31 versions & 6 rubygems