3 load
'array-numbers.rb'
7 # self.map {|d| d.to_s}.join.to_i
11 # Rational(self[0].to_i, self[1].to_i)
15 (0...self.length
).map
{|r
| self.rotate(r
)}
20 # @@primes = Primes.instance
23 # @@primes.include? self
27 @
@primes.primes
.length
31 self.prime
? && self.to_digits
.all_rotations
.map
{|n
| n
.to_i
}.all
? {|n
| n
.prime
?}
35 # self.to_s.split('').map {|d| d.to_i}
47 beginning_time
= Time
.now
48 cps
= (2..10**6).select
{|n
| n
.circular_prime
?}
51 puts
"Time elapsed #{(end_time - beginning_time)} seconds, going from #{pl0} to #{pl1} primes cached"
54 result
= RubyProf
.stop
56 printer
= RubyProf
::MultiPrinter.new(result
)
57 printer
.print(:path => ".", :profile => "profile")