 	}
 	
 	return res
-} // returns random String with length len
-
-func fibIter(x: Double) -> Double // Iterative Fibonacci
-{
-    let s5 = sqrt(5.0)
-    
-    let p1 = 1.0 / s5
-    let p2 = (1 + s5) / 2.0
-    let p3 = (1 - s5) / 2.0
-    
-    return p1 * (pow(p2, x) - pow(p3, x))
-}
-
-
-func collatz(n: Int) -> Int
-{
-	var n = n
-    var heap = [0,0]
-    
-    let s = n
-    var runs = 0
-    
-    while n > 1
-    {
-        if n < s
-        {
-            let new = runs + heap[n]
-            heap.append(new)
-            return new
-        }
-        
-        runs += 1
-        
-        if n % 2 == 0
-        {
-            let nn = n / 2
-            
-            n = nn
-        }
-        else
-        {
-            let nn = (3 * n) + 1
-            
-            n = nn
-        }
-    }
-    
-    if heap.count <= s
-    {
-        heap.append(runs)
-    }
-    
-    return runs
-}
-
-func collatzSimple(n: Int) -> Int
-{
-	var n = n
-    var runs = 0
-
-    while n > 1
-    {
-        runs += 1
-        if n % 2 == 0
-        {
-            let nn = n / 2
-            n = nn
-        }
-        else
-        {
-            let nn = (3 * n) + 1
-            n = nn
-        }
-    }
-    return runs
-}
-
-func col(n: Int)
-{
-	var provenBound = 2 // 4,2,1
-
-
-	while provenBound < n
-	{
-		var index = provenBound + 1
-
-		index = (3 * index) + 1
-		index >>= 1
-
-		while index > provenBound
-		{
-			if index & 1 == 0
-			{
-				index >>= 1
-			}
-			else
-			{
-				index = (3 * index) + 1
-			}
-		}
-		provenBound += 2
-
-	}
-	print(provenBound)	
-}
-
-func monteCarloPi(n: Int) -> Double
-{
-    var dotsInCircle = 0
-    
-    for _ in 1...n
-    {
-        if sqrt(
-			pow(  Double(arc4random()) / Double(UINT32_MAX), 2.0)
-			+ pow(Double(arc4random()) / Double(UINT32_MAX), 2.0)
-			)
-			<= 1.0
-        {
-            dotsInCircle += 1
-        }
-    }
-    
-    return (Double(dotsInCircle * 4) / Double(n))
-}
-
-func gcd(a: Int, _ b: Int) -> Int
+}
+
+func gcd(_ a: Int, _ b: Int) -> Int
 {
     if b == 0 { return a }
     return gcd(b, a % b)
 }
 
-func lcm(a: Int, _ b: Int) -> Int
+func lcm(_ a: Int, _ b: Int) -> Int
 {
     return (a / gcd(a, b)) * b
 }
+
+func factorize(_ n: Int) -> [Int]
+{
+	if isPrime(n) || n == 1 { return [n] }
+
+	var n = n
+	var res = [Int]()
+	var nthPrime = 1
+
+	while true
+	{
+		nextPrime(&nthPrime)
+
+		while n % nthPrime == 0
+		{
+			n /= nthPrime
+			res.append(nthPrime)
+
+			if isPrime(n)
+			{
+				res.append(n)
+				return res
+			}
+		}
+	}
+}

	{
		for i in range
		{
			letters.append(String(UnicodeScalar(i)))
		}
	}


/**
	Returns the n-th prime number.
*/
func getPrime(_ n: Int) -> Int
{
	precondition(n > 0, "There is no 0-th prime number")

	var prime = 2
	var primeCount = 1
