These problems are inspired in some of the problems from Project Euler. You can find them at https://projecteuler.net.
Write a function
sumMultiples35 :: Integer -> Integer that, given a
natural
,
returns the sum of all mutiples of 3 or 5 below
.
Write a function fibonacci :: Int -> Integer
that, given a natural
,
returns the
-th
element of the Fibonacci sequence.
Write a function
sumEvenFibonaccis :: Integer -> Integer that, given a
natural
,
returns the sum of all even elements less than
in the Fibonacci sequence.
Write a function largestPrimeFactor :: Int -> Int
that, given a natural
,
returns the greatest prime factor of
.
Write a function isPalindromic :: Integer -> Bool
that, given a natural
,
returns whether
is palindromic, that is, if
can be read in the same way from left to right than from right to
left.
test-1a: Function sumMultiples35 for .
test-1b: Function sumMultiples35 for big .
test-2a: Function fibonacci for .
test-2b: Function fibonacci for big .
test-3: Function sumEvenFibonaccis.
test-4: Function largestPrimeFactor.
test-5: Function isPalindromic.
Input
sumMultiples35 10 fibonacci 10 sumEvenFibonaccis 10 largestPrimeFactor 13195 isPalindromic 9062609
Output
23 55 10 29 True