Sha256: 4afdcf9441064ae6f5dd116e04cdabf3a797f6216146206ded9bfd2a3dcaa2e7

Contents?: true

Size: 440 Bytes

Versions: 20

Compression:

Stored size: 440 Bytes

Contents

describe Integer, "#totient" do
  # A000010
  TOTIENT = [1,1,2,2,4,2,6,4,6,4,10,4,12,6,8,8,16,6,18,8,12,
             10,22,8,20,12,18,12,28,8,30,16,20,16,24,12,36,18,
             24,16,40,12,42,20,24,22,46,16,42,20,32,24,52,18,
             40,24,36,28,58,16,60,30,36,32,48,20,66,32,44]

  TOTIENT.each_with_index do |totient, i|
    it "should return #{totient} for #{i.succ}" do
      i.succ.totient.should == totient
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

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