I'm doing a project that requires me to calculate a new number from previous numbers. I was thinking of using an array that way I could calculate the new number using something as follows,
setptnew[k] = 2*setptnew[k-1] + 3*setptnew[k-2];
I have to use the two previous numbers calculated to calculate the new one.
Any ideas how I would do this, I can't seem to get it to work.