I think your code should be :

```
if(n%2==0 )
{
CreatOdd(a,odd,n);
F(odd,n/2);
CreatEven(a,even,n);
F(even,n/2);
}
else
{
CreatOdd(a,odd,n);
F(odd,(n/2)+1);
CreatEven(a,even,n);
F(even,(n/2));
}
```

because when you have an odd number of elements, you will have 1 more element at an odd position.F[1,2,3,4,5] = F[1,3,5] + F[2,4] : 3 elements in odd and only 2 in even

You can simplify your code with :

```
CreateOdd(a,odd,n);
F(odd, (n/2)+n%2);
CreateEven(a,even,n);
F(even,(n/2));
```

The second mistake must be to use "global" variables (even and odd array) in a recursive function. I do not see in your code sample any declarations for even and odd.

And my last remark, will be in C++ the arrays usually start at index 0:

```
int a[1];
a[0]=1; //first element in a
a[1]=2; //element out of the array !
```

Should not be [1,3,5,2,4] ???

F[1,2,3,4,5]=F[1,3,5]+F[2,4]=F[1,5]+F[3]+F[2,4]=F[1]+F[5]+F[3]+F[2]+F[4]

Do you know that where is wrong in my code ?

thanks

(and besides, solving this problem recursively would be needlessly complex, but if you just want to train your skills in recursive programming that's fine.)