Sha256: d0c6ce1da121a88efbc741af39952fe2f0c2547fffe6134eb6cc109ee2251b30

Contents?: true

Size: 582 Bytes

Versions: 20

Compression:

Stored size: 582 Bytes

Contents

describe Integer, "#proth?" do
  # A080075
  PROTH = [3,5,9,13,17,25,33,41,49,57,65,81,97,113,129,145,
           161,177,193,209,225,241,257,289,321,353,385,417,
           449,481,513,545,577,609,641,673,705,737,769,801,
           833,865,897,929,961,993,1025,1089,1153,1217,1281,
           1345,1409]

  PROTH.each do |n|
    it "should return true for Proth number #{n}" do
      n.should be_proth
    end
  end

  (1..PROTH.last).each do |n|
    next if PROTH.include? n
    it "should return false for non-Proth number #{n}" do
      n.should_not be_proth
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

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