Here’s my recursive formula, some how It give’s 1 for all input

```
int f(int sum,int i){
if(i>n){
return ((2*sum)==(n*(n+1)/2));//ie sum==totalsum/2
}
int cnt=0;
cnt=f(sum,i+1)+f(sum+i,i+1)*(i<=n);//i<=n for 2nd eq
return cnt;
}
///
For example, if n=7, there are four solutions:
{1,3,4,6} and {2,5,7}
{1,2,5,6} and {3,4,7}
{1,2,4,7} and {3,5,6}
{1,6,7} and {2,3,4,5}
///
so f(0,1) should be 4 for n=7
```