+ 2

1+2+3+4+5+...+n
f(n) = (1+n) * n / 2
1*2*3*4*5*...*n
int f ( int n ) {
if ( n == 0 ) {
return 1 ;
}
return n * f ( n - 1 ) ;
}

+ 2

1+2+3+4+5+...+n
f(n) = (1+n) * n / 2
1*2*3*4*5*...*n
int f ( int n ) {
if ( n == 0 ) {
return 1 ;
}
return n * f ( n - 1 ) ;
}