I'm primarily a programmer and am pretty rusty at math... so forgive me if this is a stupid question.
I have four number patterns as follows:
- a) 3, 13, 31
- b) 5, 17, 37
- c) 7, 21, 43
- d) 9, 25, 49
What are the functions to get any number (n) for equation (abcd)?
I know the pattern, and how to brute-force it, but I'm lost when it comes to knowing the exact formula to get, say, the 1000th value in the pattern. The pattern is very related in all the equations.
The pattern I know is this:
Every successive value increases by 8 more than the last value increased by, except for the first value which is increased by (7 + first value).
- For instance, 3 in pattern 1 is increased by (7 + 3): 3 + 10 = 13
- 13 is then increased by 8 more than 10: 13 + 18 = 31
- 31 is then increased by 8 more than 18: 31 + 26 = 57 making a(4) = 57
Now how do I convert this knowledge into a function so that I don't have to write a programmatic loop every time I want to find x(n)?