Sha256: 37fb70bac0ad2537a8db4b36686e0d8341028c36544d2ef5f96dbc35a5bcd6af

Contents?: true

Size: 964 Bytes

Versions: 7

Compression:

Stored size: 964 Bytes

Contents

# coding: utf-8
describe Integer, "#entringer" do
  # A008281
  @seq = [
          [1,                                                     ],
          [0,    1,                                               ],
          [0,    1,    1,                                         ],
          [0,    1,    2,    2,                                   ],
          [0,    2,    4,    5,    5,                             ],
          [0,    5,   10,   14,   16,   16,                       ],
          [0,   16,   32,   46,   56,   61,   61,                 ],
          [0,   61,  122,  178,  224,  256,  272,  272,           ],
          [0,  272,  544,  800, 1024, 1202, 1324, 1385, 1385,     ],    
          [0, 1385, 2770, 4094, 5296, 6320, 7120, 7664, 7936, 7936],
        ]

  @seq.each_with_index do |row, a|
    row.each_with_index do |n, b|
      it "returns #{n} for Entringer(#{a}, #{b})" do
        a.entringer(b).should == n
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

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