Jan 27, 2012 at 7:07pm UTC
Ok so I just can't wrap my head around a way to do this. I've been sitting here for awhile and I'm stuck
Jan 27, 2012 at 7:30pm UTC
You can do this with a loop and three variables!
You add the first two numbers, which create a third, you then add the sencond number to the third, and so on.
You need to start with 0 and 1.
0 + 1 = 1;
1 + 1 = 2;
1 + 2 = 3;
2 + 3 = 5;
3 + 5 = 7;
...And so on.
Variables: lowNumber, highNumber, tempNumber.
Jan 27, 2012 at 7:33pm UTC
Oh wow! When you actually write it out like that, it becomes so easy. I was wreckin my head trying to figure this out, and I was trying to stay in 2 variables but it wasnt happening. Thanks!
Jan 27, 2012 at 7:35pm UTC
ahaha no prob. I thought it looked hard, from the way wiki had the formula set out, until I realised what it was doing!
EDIT:
I've never been good at looking at formula, lol.
Last edited on Jan 27, 2012 at 7:36pm UTC
Jan 27, 2012 at 7:36pm UTC
*giggle*
It's like you were mixing up Fibonacci and primes.
Last edited on Jan 27, 2012 at 7:37pm UTC
Jan 27, 2012 at 7:39pm UTC
ahahaha! Yeah, I'm a teacher of math ;)
...I suck at primes, I had to write a C++ add to find out what they were!