#include <stdio.h>

int sum(int n) {
    if (n <= 1) {
        return 1;
    } else {
        return n + sum(n - 1);
    }
}

int sum_imp(int n) {
    int i = 1;
    int sum = 0;
    while (i <= n) {
        sum += i;
        i += 1;
    }
    return sum;
}

int main() {
    int n = 100;
    printf("Sum(%d) = %d, theoretical = %d\n", n, sum(n), n * (n + 1) / 2);
}
