/**
 * Given a range of numbers, this function calculates and returns all the prime numbers within the range.
 *
 * @param start the starting number of the range
 * @param end the ending number of the range
 * @return a list of prime numbers within the range
 */
fun calculatePrimes(start: Int, end: Int): List<Int> {

    val primes = mutableListOf<Int>()

    for (num in start until end) {
        var isPrime = true

        if (num > 1) {
            for (i in 2 until (num / 2) + 1) {
                if (num % i == 0) {
                    isPrime = false
                    break
                }
            }
        }

        if (isPrime) {
            primes.add(num)
        }
    }

    return primes
}
/**
 * Given a range of numbers, this function calculates and returns all the prime numbers within the range.
 *
 * @param start the starting number of the range
 * @param end the ending number of the range
 * @return a list of prime numbers within the range
 */
fun calculatePrimes(start: Int, end: Int): List<Int> {
/**
 * Given a range of numbers, this function calculates and returns all the prime numbers within the range.
 *
 * @param start the starting number of the range
 * @param end the ending number of the range
 * @return a list of prime numbers within the range
 */
fun calculatePrimes(start: Int, end: Int): List<Int> {

    val primes = mutableListOf<Int>()

    for (num in start until end) {
        var isPrime = true

        if (num > 1) {
            for (i in 2 until (num / 2) + 1) {
                if (num % i == 0) {
                    isPrime = false
                    break
                }
            }
        }

        if (isPrime) {
            primes.add(num)
        }
    }

    return primes
}