Sha256: 1638efe415e152f8f5e0cc8c580693bbb5191bc231106334fb7d4a3e8ef42894

Contents?: true

Size: 579 Bytes

Versions: 20

Compression:

Stored size: 579 Bytes

Contents

describe Integer, "#noncototient?" do
  # A005278
  @seq = [10,26,34,50,52,58,86,100,116,122,130,134,146,154,
          170,172,186,202,206,218,222,232,244,260,266,268,
          274,290,292,298,310,326,340,344,346,362,366,372,
          386,394,404,412,436,466,470,474,482,490,518,520].to_seq

  @seq.sample(10).each do |n|
    it "should return true for noncototient number #{n}" do
      n.should be_noncototient
    end
  end

  @seq.invert.sample(10).each do |n|
    it "should return false for cototient number #{n}" do
      n.should_not be_noncototient
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
numb-0.186.0 spec/numb/noncototient_spec.rb
numb-0.185.0 spec/numb/noncototient_spec.rb
numb-0.184.0 spec/numb/noncototient_spec.rb
numb-0.181.0 spec/numb/noncototient_spec.rb
numb-0.170.0 spec/numb/noncototient_spec.rb
numb-0.152.0 spec/numb/noncototient_spec.rb
numb-0.138.0 spec/numb/noncototient_spec.rb
numb-0.125.0 spec/numb/noncototient_spec.rb
numb-0.114.0 spec/numb/noncototient_spec.rb
numb-0.111.0 spec/numb/noncototient_spec.rb
numb-0.109.0 spec/numb/noncototient_spec.rb
numb-0.99.0 spec/numb/noncototient_spec.rb
numb-0.96.0 spec/numb/noncototient_spec.rb
numb-0.89.0 spec/numb/noncototient_spec.rb
numb-0.84.0 spec/noncototient_spec.rb
numb-0.77.0 spec/noncototient_spec.rb
numb-0.72.1 spec/noncototient_spec.rb
numb-0.72.0 spec/noncototient_spec.rb
numb-0.68.0 spec/noncototient_spec.rb
numb-0.63.0 spec/noncototient_spec.rb