Sha256: 03d757ceb6c6fe97dd6ca5e043fbe11beea6824dfb50b33810a68a0dabeec908

Contents?: true

Size: 518 Bytes

Versions: 5

Compression:

Stored size: 518 Bytes

Contents

# coding: utf-8
describe Integer, "#first_with_n_divisors" do
  # A005179
  @seq = [1,2,4,6,16,12,64,24,36,48,1024,60,4096,192,144,
          120,65536,180,262144,240,576,3072,4194304,360,
          1296,12288,900,960,268435456,720,1073741824,840,
          9216,196608,5184,1260,68719476736,786432,36864,
          1680,1099511627776,2880]

  @seq.to_enum.with_index(1).each do |d, n|
    it "returns #{d} as the first number with exactly #{n} divisors" do
      n.first_with_n_divisors.should == d
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

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