Problem Set 2 ============= Write good, clean, elegant code. Focus on good naming, functional decomposition and testing. Writing auxiliary functions that simplify the task and/or add to the utility of the function to be written is strongly encouraged. 1. Write a function that checks if the given integer argument is a prime. **Python signature** .. code-block:: Python def is_prime(n: int) -> bool: 2. Write a function to factorize a given positive integer. Use it to solve project Euler problem 3. **C++ signature** .. code-block:: C++ vector factorize(int a) { vector factors; return factors; } **Java signature** .. code-block:: Java public List factorize(int a) { List factors = new ArrayList<>(); return factors; } 3. Write a program to solve project Euler problem 1. Use different data structures, language constructs, and libraries and write at least three distinct solutions. 4. The famous Collatz-Kakutani-Ulam sequence aka the Collatz sequence aka the hailstone sequence is defined as follows: 1. Start with any positive integer #. If the integer is even divide it by 2 #. If the integer is odd multiple by 3 and add 1. #. Using the newly obtained number, repeat from step 2 For example, starting number 7 gives you the sequence: 7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1. If you try out a few more you will notice that all of them end in 4, 2, 1 (since applying the steps to 1 will repeat 4, 2, 1). Write a program that prints out the sequence for the given argument. Remember: the sequence includes the starting number and ends in 4, 2, 1