Sha256: 8f61c0d2e7980355e80141cd5b546d288dfef25a34cabaa2a913a38455fdbdf7

Contents?: true

Size: 715 Bytes

Versions: 4

Compression:

Stored size: 715 Bytes

Contents

# coding: utf-8
describe Integer, "#ramanujan_tau" do
  # A000594
  @seq = [1,-24,252,-1472,4830,-6048,-16744,84480,-113643,
          -115920,534612,-370944,-577738,401856,1217160,
          987136,-6905934,2727432,10661420,-7109760,
          -4219488,-12830688,18643272,21288960,-25499225,
          13865712,-73279080,24647168]

  @seq.to_enum.with_index(1).each do |r, n|
    it "returns #{r} for #{n}" do
      n.ramanujan_tau.should == r
    end
  end

  # Confirm some arbitrary large(ish) values to confirm we aren't subject to
  # rounding errors
  [[1357, -96743736788237280], [1314, 3992391292945104]].each do |n, r|
    it "returns #{r} for #{n}" do
      n.ramanujan_tau.should == r
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

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