# The mystery of 107 numbers

Find the algorithm that was used to create the following sequence of numbers:

BAH BAA BBA BAD BBD BAG BBG BAJ BBJ BBC BCC BBF BCF BBI BCI BCB BDB BCE BDE BCH BDH BDA BEA BDD BED BDG BEG BDJ BEJ BEC BFC BEF BFF BEI BFI BFB BGB BFE BGE BFH BGH BGA BHA BGD BHD BGG BHG BGJ BHJ BHC BIC BHF BIF BHI BII BIB BJB BIE BJE BIH BJH BJA CAA BJD CAD BJG CAG BJJ CAJ CAC CBC CAF CBF CAI CBI CBB CCB CBE CCE CBH CCH CCA CDA CCD CDD CCG CDG CCJ CDJ CDC CEC CDF CEF CDI CEI CEB CFB CEE CFE CEH CFH CFA CGA CFD CGD CFG CGG

All numbers are in base 10

The algorithm is:

Starting with 107, alternate between subtracting 7 and adding 10.
This generates a sequence like: 107 100 110 103 113 106 ...

Then, taking that sequence of numbers:

Substitute 0=A, 1=B, 2=C, ..., 9=J
The sequence is now: BAH BAA BBA BAD BBD BAG ...

Generate 107 numbers using this algorithm to arrive at the sequence in the puzzle!

My thought process:

First, I noticed that the question itself mentions numbers twice, even though the sequence is clearly letters. Then I noticed that none of the letters go past the letter J, which suggests a simple substitution cipher where 0 is A. So the first step was to take the whole sequence and convert it into numbers.
From there, I was trying to make sense of numbers -- I had actually overlooked the fact that the question mentions sequence and was playing with converting the numbers into something else, like RGB 0-255 and was saved by the fact that the last number of the sequence CGG is 266 which is clearly outside the range.
Realizing that it's supposed to be a sequence made it really easy to recognize the -7, +10 pattern. The fact that it was a sequence of 107 numbers starting with 107 made it clear that the substitution was correct.
So a bit of intuition and a bit of luck :)

• May I ask how did you come up with the solution? I'm curious about the steps you took Commented Apr 23 at 23:03
• @webadventurer added my thought process as part of the answer; I may have had some JS in the web console to help -- was fun! :) Commented Apr 23 at 23:15