- Discovered closed-form Fibonacci formula:
floor(cosh(-0.111572 + 0.481212 * n)) - Formula predicts first 30 Fibonacci numbers with perfect accuracy
- Works on sequences where arithmetic/geometric formulas fail
- GUI-based workflow—no programming required to find the formula
The Problem
Given the Fibonacci sequence (1, 1, 2, 3, 5, 8, 13, ...), find a closed-form formula f(n) that computes the nth term without recursion.
TuringBot vs Manual Derivation
| Approach | TuringBot | Manual / Wolfram Alpha |
|---|---|---|
| Input | Just the sequence values | Must know sequence type |
| Assumptions | None—discovers form automatically | Must guess functional form |
| Any OEIS sequence | Yes | Only well-known types |
| Math expertise needed | No | Yes |
Finding the Formula
Load fibonacci.txt (first 30 terms) into TuringBot:
1 1
2 1
3 2
4 3
5 5
6 8
7 13
8 21
9 34
10 55
A list of the first 30 terms can be found in this file: fibonacci.txt.
TuringBot takes as input TXT or CSV files with one variable per column and efficiently finds formulas that connect those variables. This is what it looks like after we load fibonacci.txt and run the optimization:

The software finds not only a single formula but the best formulas of all possible complexities. A larger formula is only shown if it performs better than all simpler alternatives. In this case, the last formula turned out to predict with perfect accuracy every single one of the first 30 Fibonacci terms. The formula is the following:
f(x) = floor(cosh(-0.111572 + 0.481212 * x))
A very elegant solution. The same procedure can be used to find a formula for the nth term of any other sequence (if it exists).
Conclusion
In this tutorial, we have seen how the symbolic regression software TuringBot can be used to find a closed-form expression for the nth term in a sequence of numbers. We found a very short formula for the Fibonacci sequence by simply writing it into a text file with one number per row and loading this file into the software.
If you are interested in trying TuringBot your data, you can download it from the official website. It is available for both Windows and Linux.