Sha256: 1ee585e6c42f16ea56c65c2cbf82e52629f755717ea6c342b43ebe153c0e64a2

Contents?: true

Size: 683 Bytes

Versions: 14

Compression:

Stored size: 683 Bytes

Contents

describe Integer, "#superabundant?" do
  # A004394
  SUPERABUNDANT = [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]

  SUPERABUNDANT.first(20).each do |n|
    it "should return true for superabundant number #{n}" do
      n.should be_superabundant
    end
  end

  ((1..SUPERABUNDANT.last).first(20) - SUPERABUNDANT).each do |n|
    it "should return false for non-superabundant number #{n}" do
      n.should_not be_superabundant
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
numb-0.138.0 spec/numb/superabundant_spec.rb
numb-0.125.0 spec/numb/superabundant_spec.rb
numb-0.114.0 spec/numb/superabundant_spec.rb
numb-0.111.0 spec/numb/superabundant_spec.rb
numb-0.109.0 spec/numb/superabundant_spec.rb
numb-0.99.0 spec/numb/superabundant_spec.rb
numb-0.96.0 spec/numb/superabundant_spec.rb
numb-0.89.0 spec/numb/superabundant_spec.rb
numb-0.84.0 spec/superabundant_spec.rb
numb-0.77.0 spec/superabundant_spec.rb
numb-0.72.1 spec/superabundant_spec.rb
numb-0.72.0 spec/superabundant_spec.rb
numb-0.68.0 spec/superabundant_spec.rb
numb-0.63.0 spec/superabundant_spec.rb