Sha256: 2ac601732ec7191a50eab91ce762e40a1eac7cde0b3604d01ed438b21105cc70

Contents?: true

Size: 249 Bytes

Versions: 3

Compression:

Stored size: 249 Bytes

Contents

class String
  def palindrome?; self == reverse; end
end

class Integer
  def strictly_non_palindromic?
    return true if (0..4).include?(self) or self == 6
    prime? and (2..(Math.sqrt(self).floor)).none?{|base| base(base).palindrome?}
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
numb-0.114.0 lib/numb/strictly_non_palindromic.rb
numb-0.111.0 lib/numb/strictly_non_palindromic.rb
numb-0.109.0 lib/numb/strictly_non_palindromic.rb