[Sequences] Creating a formula from a list of numbers
I am trying to come up with a way to solve a computer science problem in O(1) time, and I think it may be possible to create a mathematical formula to generate the required output.
In my analysis, I have come up with 3 (infinite) sequences of numbers (one being the required output itself), and if I could find a formula to generate any one of these sequences, then I could solve the problem. I have been working with sequences and series in calculus 2 for the last 2 weeks, but we haven't dealt with anything that looks like these, so I'm at a loss.
a_n (required output): {3, 3, 7, 6, 6, 7, 15, 10, 10, 14, 13, 13, 14, 15, 31, 18, 18, 22, 21, 21, 22, 30, 25, 25, 29, 28, 28, 29, 30, 31, ...}
a_n - n: {2, 1, 4, 2, 1, 1, 8, 2, 1, 4, 2, 1, 1, 1, 16, 2, 1, 4, 2, 1, 1, 8, 2, 1, 4, 2, 1, 1, 1, 1, ...}
log_2(a_n - n): {1, 0, 2, 1, 0, 0, 3, 1, 0, 2, 1, 0, 0, 0, 4, 1, 0, 2, 1, 0, 0, 3, 1, 0, 2, 1, 0, 0, 0, 0, ...}
There is clearly a pattern here, so there should be some way to describe that pattern mathematically. Does anyone have any ideas?
Posted Apr 24, 2017, 4:06 AM UTC