Sha256: 34fa1fb0dad53ab7423319f06c36b7af02bee897cd688a1f792c6b20dac1a382

Contents?: true

Size: 185 Bytes

Versions: 12

Compression:

Stored size: 185 Bytes

Contents

# coding: utf-8
class Integer
  def noncototient?
    return false if self < 10 or odd?
    (Math.sqrt(self).floor..(2 * self)).none? do |m|
      m.cototient == self
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
numb-0.114.0 lib/numb/noncototient.rb
numb-0.111.0 lib/numb/noncototient.rb
numb-0.109.0 lib/numb/noncototient.rb
numb-0.99.0 lib/numb/noncototient.rb
numb-0.96.0 lib/numb/noncototient.rb
numb-0.89.0 lib/numb/noncototient.rb
numb-0.84.0 lib/numb/noncototient.rb
numb-0.77.0 lib/numb/noncototient.rb
numb-0.72.1 lib/numb/noncototient.rb
numb-0.72.0 lib/numb/noncototient.rb
numb-0.68.0 lib/numb/noncototient.rb
numb-0.63.0 lib/numb/noncototient.rb