Sha256: c86501ac4825c21faf4181693f5e60a0378bdd5fdf57797f03541a9b01e56e45

Contents?: true

Size: 613 Bytes

Versions: 20

Compression:

Stored size: 613 Bytes

Contents

describe Integer, "#highly_abundant?" do
  # A002093
  @seq = [1,2,3,4,6,8,10,12,16,18,20,24,30,36,42,48,60,72,
          84,90,96,108,120,144,168,180,210,216,240,288,300,
          336,360,420,480,504,540,600,630,660,720,840,960,
          1008,1080,1200,1260,1440,1560,1620,1680,1800,1920,
          1980,2100].to_seq

  @seq.each do |n|
    it "should return true for highly abundant number #{n}" do
      n.should be_highly_abundant
    end
  end

  @seq.invert.sample(10).each do |n|
    it "should return false for non-highly-abundant number #{n}" do
      n.should_not be_highly_abundant
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

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