Sha256: 1eb5df81c37019dbb0cb1f96b4cf7658dd1914bc420bd0891c71d791b513878d

Contents?: true

Size: 121 Bytes

Versions: 11

Compression:

Stored size: 121 Bytes

Contents

class Integer
  def wieferich_prime?
    return false unless prime?
    (2**(self - 1)).modulo(self ** 2) == 1
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

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