#include <iostream>
#include <cmath>

using namespace std;

//Catfish2's function
unsigned long int your_homework(unsigned long int n)
{
    if (n == 0)
        return 0;

    return pow(n, n) + your_homework(n - 1);
}

int main()
{
    unsigned long int n, sum;
    n = 4; //replace this value for whatever you want n to be off course
    sum = your_homework(n);
    cout << "sum= " << sum << endl;
    return 0;
}