Permalink
Browse files

space indent

  • Loading branch information...
1 parent 09cc519 commit 89102ec7b465f41ff6bc7d777ef27ca835e25da3 Andrew Korzhuev committed Apr 13, 2012
Showing with 5 additions and 5 deletions.
  1. +2 −2 euler/3.hs
  2. +3 −3 euler/4.hs
View
@@ -15,11 +15,11 @@ primeFactors n | n > 1 = go n primes
primes = 2 : filter isPrime [3,5..]
oddSqrt n = if odd x then x else x - 1
- where x = ceiling . sqrt $ fromIntegral n
+ where x = ceiling . sqrt $ fromIntegral n
isFactor x y = x `mod` y == 0
lrgstPrimeFactor x = head . dropWhile (not . gotcha) $ [oddSqrt x, oddSqrt x - 2 .. 1]
- where gotcha y = isFactor x y && isPrime y
+ where gotcha y = isFactor x y && isPrime y
main = putStrLn . show . lrgstPrimeFactor $ 600851475143
View
@@ -13,9 +13,9 @@ palindromes = [x*100000 + y*10000 + z*1000 + z*100 + y*10 + x | x <- [9,8..1], y
-- O(n) = 1000
threeFactors' x 1000 = False
threeFactors' x y = x `mod` y == 0
- && between (x `div` y) 100 999
- || threeFactors' x (y + 1)
- where between x y z = y <= x && x <= z
+ && between (x `div` y) 100 999
+ || threeFactors' x (y + 1)
+ where between x y z = y <= x && x <= z
threeFactors x = threeFactors' x 100

0 comments on commit 89102ec

Please sign in to comment.