Sha256: 008de5cab7fa4d4dd9e4ad937929d88af5ca48fea6ee40945c8510f4ebd3b0f0

Contents?: true

Size: 584 Bytes

Versions: 20

Compression:

Stored size: 584 Bytes

Contents

describe Integer, "#balanced_prime?" do
  # A006562
  @seq = [5,53,157,173,211,257,263,373,563,593,607,653,733,
          947,977,1103,1123,1187,1223,1367,1511,1747,1753,
          1907,2287,2417,2677,2903,2963,3307,3313,3637,3733,
          4013,4409,4457,4597,4657,4691,4993,5107,5113,5303,
          5387,5393].to_seq

  @seq.each do |n|
    it "returns true for balanced prime #{n}" do
      n.should be_balanced_prime
    end
  end

  @seq.invert.sample(20).each do |n|
    it "returns false for non-balanced-prime #{n}" do
      n.should_not be_balanced_prime
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

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