6 self.map
{|d
| d
.to_s
}.join
.to_i
10 Rational(self[0].to_i
, self[1].to_i
)
14 (0...self.length
).map
{|r
| self.rotate(r
)}
19 @
@primes = Primes
.instance
22 @
@primes.include? self
26 @
@primes.primes
.length
30 self.to_digits
.all_rotations
.map
{|n
| n
.to_i
}.all
? {|n
| n
.prime
?} if self.prime
?
34 self.to_s
.split('').map
{|d
| d
.to_i
}
44 beginning_time
= Time
.now
45 cps
= (2..10**6).select
{|n
| n
.circular_prime
?}
48 puts
"Time elapsed #{(end_time - beginning_time)} seconds, going from #{pl0} to #{pl1} primes cached"
51 result
= RubyProf
.stop
53 printer
= RubyProf
::MultiPrinter.new(result
)
54 printer
.print(:path => ".", :profile => "profile")