Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mySumRecPM :: [Int] -> Int
- mySumRecPM [] = 0
- mySumRecPM (x:xs) = x + mySumRecPM xs
- primesInRangesLC :: Int -> Int -> [Int]
- primesInRangesLC x y = [d | d <- [min x y .. max x y], isPrime d && d >= 3]
- primesInRangesHOF :: Int -> Int -> [Int]
- primesInRangesHOF x y = filter (\d -> isPrime d && d >= 3) [min x y .. max x y]
- sumUnevenLC :: Int -> Int -> Int
- sumUnevenLC x y = sum [d | d <- [x..y], mod d 2 /= 0]
- isAscending :: Int -> Bool
- isAscending n = n < 10 || mod n 10 >= mod (div n 10) 10 && isAscending (div n 10)
- sumSpecialPrimes :: Int -> Int -> Int
- sumSpecialPrimes n d = sum $ take n $ filter (\x -> isPrime x && elem (intToDigit n) (show x)) [1..]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement