JustPaste.it

private static int weird(int n)
{
if(n<1)
return 0;
if(n%2==0)
return weird (n-1) + ((n*n));
else
return weird (n-1) + (n*2);
}