Im attemtping to return the next value in this suequence recursively 1, 4, 11, 34, 101
this is what i've done thus far, im not sure how to pass this list to the function to compute the next value which i believe to be 304. can some explain how i shoud write the main.
also in cases where the nth-1 value etc is needed how do you go about getting these list to the method
Thank you guys.
public static int fibo(int nthfibo)
{
if (nthfibo == 1)
return 1;
else if (nthfibo != 1 && nthfibo % 2 ==0)
{
return fibo(nthfibo) *3-1;
}
else
{
return fibo(nthfibo)*3+1;
}
}