Sha256: 5ffac970b702865a90a8780a1fef1bfbd5fd8c92d3e677896d41cbc6230eeab1

Contents?: true

Size: 92 Bytes

Versions: 10

Compression:

Stored size: 92 Bytes

Contents

class Integer
  def twin_prime?(p)
    [p, self].all?(&:prime?) and p == self + 2
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
numb-0.152.0 lib/numb/twin_prime.rb
numb-0.138.0 lib/numb/twin_prime.rb
numb-0.125.0 lib/numb/twin_prime.rb
numb-0.114.0 lib/numb/twin_prime.rb
numb-0.111.0 lib/numb/twin_prime.rb
numb-0.109.0 lib/numb/twin_prime.rb
numb-0.99.0 lib/numb/twin_prime.rb
numb-0.96.0 lib/numb/twin_prime.rb
numb-0.89.0 lib/numb/twin_prime.rb
numb-0.84.0 lib/numb/twin_prime.rb