Check for Fibonacci Like Sequence (Python)
Takes 3 values, and calculates whether they appear to be part of a Fibonacci integer sequence (i.e. g(n + 2) = g(n) + g(n + 1))
We only check if the sequence is Fibonacci like, not that the values are part of the Fibonacci sequence (for example, they may instead be a series of Lucas Numbers)
Values should be passed to the function in the order that they were observed
Return value is a list with two entries
- Boolean - are the numbers part of a sequence?
- Mixed - If part of a sequence, is the sequence running ascending (asc) or descending (desc). If not part of a sequence this values will be False
Used as part of the solution to my May 2016 Puzzle