I’ve been working for a while on a way to predict the next number in a sequence (for non-mathematicians). In the beginning, I wanted to train a neural network to figure it out. While that may still work for some sequences, it didn’t work at all for the sequence I was trying to solve.

Therefore, I tried to solve sequences the way that I would solve them on paper. This code is still being developed, but I made it public early because I saw a challenge on SoloLearn that my code successfully solved.

At the moment, this code can detect and solve arithmetic, geometric, fibonacci, quadratic, and linear sequences, as well as triangular, square, and cube numbers. But, I’m adding more! I only went public so that I could post my answer to the challenge, but I have more unsolved sequences that I am still working on.

Furthermore, after posting my comment, I did, in fact, modify the code to display the rule. I am going to go through and display the rules for all the solutions.