Sha256: aa2a29656945ffb5ab75c27df6bbe15a8e1b477e3440ac9a65d25a70d93d63a7

Contents?: true

Size: 611 Bytes

Versions: 6

Compression:

Stored size: 611 Bytes

Contents

describe Integer, "#superabundant?" do
  # A004394
  @seq = [1,2,4,6,12,24,36,48,60,120,180,240,360,720,840,
          1260,1680,2520,5040,10080,15120,25200,27720,55440,
          110880,166320,277200,332640,554400,665280,720720,
          1441440,2162160,3603600,4324320,7207200,8648640,
          10810800].first(17)

  @seq.each do |n|
    it "should return true for superabundant number #{n}" do
      n.should be_superabundant
    end
  end

  @seq.to_seq.invert.sample(20).each do |n|
    it "should return false for non-superabundant number #{n}" do
      n.should_not be_superabundant
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
numb-0.186.0 spec/numb/superabundant_spec.rb
numb-0.185.0 spec/numb/superabundant_spec.rb
numb-0.184.0 spec/numb/superabundant_spec.rb
numb-0.181.0 spec/numb/superabundant_spec.rb
numb-0.170.0 spec/numb/superabundant_spec.rb
numb-0.152.0 spec/numb/superabundant_spec.rb