Sha256: 44c340e5f99a3d6ac00da7bf82a5020f7fa7b5d429fa728d1d2a8bff629e1e18
Contents?: true
Size: 1.13 KB
Versions: 5
Compression:
Stored size: 1.13 KB
Contents
# coding: utf-8 describe Integer, "#lucas2" do @seq = { # A000204 [1, -1] => [2]+[1,3,4,7,11,18,29,47,76,123,199,322,521,843,1364, 2207,3571,5778,9349,15127,24476,39603,64079, 103682,167761,271443,439204,710647,1149851, 1860498,3010349,4870847,7881196,12752043], # A002203 [2, -1] => [2,2,6,14,34,82,198,478,1154,2786,6726,16238, 39202,94642,228486,551614,1331714,3215042,7761798, 18738638,45239074,109216786,263672646,636562078, 1536796802,3710155682,8957108166,21624372014, 52205852194], # A014551 [1, -2] => [2,1,5,7,17,31,65,127,257,511,1025,2047,4097,8191, 16385,32767,65537,131071,262145,524287,1048577, 2097151,4194305,8388607,16777217,33554431, 67108865,134217727,268435457,536870911,1073741825, 2147483647] } @seq.each do |(p, q), seq| seq.each_with_index do |l, n| it "returns #{l} for the #{n}#{n.ordinal} Lucas number of the 2nd kind (#{p}, #{q})" do n.lucas2(p, q).should == l end end end end
Version data entries
5 entries across 5 versions & 1 rubygems