I’ve been trying to programmatically solve this sequence for almost 4 months:

123, 117, 108, 99, ….

I found this sequence in a SoloLearn daily teaser, and it is not in the OEIS (Online Encyclopedia of Integer Sequences) database. I’ve tried using neural networks and mathematical equations to solve it, but I’ve made little progress. I largely stopped working on this project once I discovered OEIS, but I never fully shook it out of my head.

Then, while doing unrelated research, I looked up Monte Carlo simulations. This inspired me to think of the sequence values as stock prices, and to use Monte Carlo to predict the next number in the sequence like it would predict the next price if this sequence was a stock’s price history.

I don’t have any code to show you, because it didn’t work.

I had to find the Monte Carlo equations, so I decided to test the math before taking the time to write and debug the code. If my math was correct, and I double-checked, then the prediction was not the value that I was hoping for.

I apologize for not knowing how to use mathematical symbols in WordPress, but I will be trying to explain this at a non-mathematician level, anyway.

Calculate the mean (average): (123 + 117 + 108 + 99) / 4 = 111.75 Subtract the mean 111.75 from each value, then square; for example, (123 – 111.75)^2 Sum up the results from #2 above, then divide the sum 331.25 by the number of data points 4; the result, 82.8125, is the variance Divide the variance by 2 = 41.40625 Subtract #4 from the mean 111.75 = 70.34375

I’m looking for a solution of 81. The rule is to add up the digits of a number N, then subtract that from N. The digits of 99 add up to 18, and 99 – 18 = 81. Notwithstanding the mathemeticians’ argument that there are infinite possible answers, I’m still looking for just one.

If I ever decide to create a Monte Carlo stock predictor, at least I already have the math for it.