I've spent a few days trying different things but I can't figure it out. If you're unsure of what a Fibonacci Number is, it's basically an ordering of numbers where the previous two numbers get added together to find the next number in the sequence. Here's some of the beginning sequence,
1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ect...
If my definition isn't very good then here is the dictionary's definition,
A series of numbers in which each number ( Fibonacci number ) is the sum of the two preceding numbers. The simplest is the series 1, 1, 2, 3, 5, 8, etc.
Here's a link to the wiki page that provides an equation. I couldn't understand the equation myself. That's one of the things I need help with. I also don't quite understand how to put the equation in Lua. Here's some code sorta explaining what I want to do,
local Number = math.random(1000)
local function Check(Num)
if Num == Num/2*.5 then--WRONG MATH
return true
else
return false
end
if Check() then
print('It is a Fibonacci Number!')
else
print("It's not a Fibonacci Number")
end
Where the code says WRONG MATH, is where I don't understand how to fit the number into an equation.
I really wanna know the answer, but how you came to the answer is more valuable. Thank you for your time.

1 comment
Just what do you need it for? (I'm simply curious)