How do I generate the first 12 numbers in the sequence 1, 1, 1, 2, 2, 3, 4, 5, 7, 9 using a while loop?

I have figured out the formula to work the sequence out which is the use the each number in the sequence uses the previous previous previous number + the previous previous number for example to get the number 4 you use the previous x3 number which is the first 2 in the sequence plus the previous x2 number which is the second 2 in the sequence. I understand that I have to use 4 variables and then swap the number accordingly in the loop but i cant quite figure out...

Read More »

By: StackOverFlow - Friday, 9 November

Related Posts