lib/numb/leyland.rb in numb-0.114.0 vs lib/numb/leyland.rb in numb-0.125.0
- old
+ new
@@ -1,8 +1,8 @@
class Integer
def leyland?
- (2..Math.sqrt(self)).each do |x|
- (x..Math.sqrt(self)).each do |y|
+ (2..sqrt).each do |x|
+ (x..sqrt).each do |y|
sum = x**y + y**x
return true if sum == self
break if sum > self
end
end