Loops: gcd and isPrime