I'm working with some specific numbers concerning a calendar calculation. Basically, 13 years in a sequence correspond to 13 different numbers:
| Year | Given number |
|---|---|
| Year 1 | 1 |
| Year 2 | 10 |
| Year 3 | 6 |
| Year 4 | 2 |
| Year 5 | 11 |
| Year 6 | 7 |
| Year 7 | 3 |
| Year 8 | 12 |
| Year 9 | 8 |
| Year 10 | 4 |
| Year 11 | 13 |
| Year 12 | 9 |
| Year 13 | 5 |
(And so on... year 14 --- 1, year 15 --- 10, year 16 --- 6).
As you can see, there is a difference of 9 between each number and the next, with the condition that it must not exceed 13 (10 goes to 6 because 10+9= 19 and 19 - 13 = 6 and so on).
I've been trying to find a formula that gives the corresponding number of a given year (e. g. you input 8 and it gives you 12) but can't seem to find one. I think it is related to modular arithmetic but I'm unfamiliar with it.
What path can you suggest to uncover the pattern?
The recursive formula is $$x_{n+1}=(x_n+9) \ \textrm{mod} \ 13$$