Sha256: c08eef140b0ec3456d6aeaa841403c3ed57664f3924e0365e9a2efdbde8e47fa

Contents?: true

Size: 466 Bytes

Versions: 36

Compression:

Stored size: 466 Bytes

Contents

describe Integer, "#politeness" do
  it "returns number of non-trivial ways to write n as the sum of >= 2 consecutive integers" do
    [0,0,0,1,0,1,1,1,0,2,1,1,1,1,1,3,0,1,2,1,1,3,1,1,
     1,2,1,3,1,1,3,1,0,3,1,3,2,1,1,3,1,1,3,1,1,5,1,1,1,
     2,2,3,1,1,3,3,1,3,1,1,3,1,1,5,0,3,3,1,1,3,3,1,2,1,
     1,5,1,3,3,1,1,4,1,1,3,3,1,3,1,1,5,3,1,3,1,3,1,1,2,
     5,2].each_with_index do |politeness, number|
      number.politeness.should == politeness
    end
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

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