[MATH]\text {Define } n \in \mathbb Z \text { and } n > 2.[/MATH]
[MATH]\text {Define } p_0 = 0.[/MATH]
[MATH]\text {Define } q_0 = 0.[/MATH]
[MATH]k \text { is a positive integer} < n \implies p_k = np_{k-1} + k \text { and } q_k = (n - 2)p_k + k.[/MATH]
This generalizes the problem. In the actual problem, n = 10. But we shall work through the problem if n = 8 or n = 16 as well.
Lat's look at the first 3 p's if n = 8 or n = 10 or n = 16.
[MATH]n = 8 \implies p_1 = 8(0) + 1 = 1 = 8^0(1), \ p_2 = 8(1) + 2 = 10 = 8^1(1) + 8^0(2), \text { and }[/MATH]
[MATH]q_3 = 8(10) + 3 = 83 = 8^2(1) + 8^1(2) + 8^0(3).[/MATH]
Although the sequence 1, 10, 83 does not seem interesting, it becomes so if we show those numbers in octal notation. They become 1, 12, and 123 in octal.
[MATH]n = 10 \implies p_1 = 10(0) + 1 = 1, \ p_2 = 10(1) + 2 = 12, \text { and } p_3 = 10(12) + 3 = 123.[/MATH]
Same digits in decimal.
[MATH]n = 16 \implies p_1 = 16(0) + 1 = 1,\ p_2 = 16(1) + 2 = 18 = 16^1(1) + 16^0(2), \text { and }[/MATH]
[MATH]p_3 = 16(18) + 3 = 291 16^2(1) + 16^1(2) + 16^0(3).[/MATH]
Same digits in hexadecimal 1, 12, and 123.
In short, the first n - 1 p's can be expressed, in numerals to base n, in terms of ascending digits starting with 1, 12, etc. Let's prove that.
[MATH]p_1 = np_0 + 1 = n(0) + 1 = 1 = n^0 * 1 = \left ( \sum{i=1}^1 n^{(1-i)} * i \right ).[/MATH]
Thus, for any n > 2, there certainly is at least one positive digit j such that
[MATH]p_j = \left ( \sum_{i=1}^j n^{(j-i)} * i \right ).[/MATH]
[MATH]p_{j+1} = np_j + (j + 1) = np_j + n^0 * (j + 1)= n \left ( \sum{i=1}^j n^{(j-i)} * i \right) + n^0 * (j + 1) =[/MATH]
[MATH]\left ( \sum_{i=1}^j n^{\{1 + (j - i)\}} * i \right ) + n^{\{(j+1)-(j+1)\}} * (j + 1) = \left ( \sum_{i=1}^{j + 1}n^{\{(j+1)-i\}} * i \right ).[/MATH]
So, by induction, [MATH]p_k = \left ( \sum_{i=1}^k n^{(k-i)} * i \right ).[/MATH]
But that is how we create base n notation.
Let's look at the first three q's. For examples, refer back to p values.
[MATH]n = 8 \implies q_1 = (8 - 2)(1) + 1 = 7 = 8^0 * 7,\ q_2 = 6(10) + 2 = 62 = 8^1 * 7 + 8^0 * 6,[/MATH]
[MATH]q_3 = 6(83) + 3 = 501 = 8^2(7) + 8^1(6) + 8^0(5).[/MATH]
In octal, those are 7, 76, and 765 respectively. Octal digits in reverse order.
[MATH]n = 10 \implies q_1 = 8(1) + 1 = 9,\ q_2 = 8(12) + 2 = 98,\ 8(123)) + 3 = 984 + 3 = 987.[/MATH]
Decimal digits in reverse order.
[MATH]n = 16 \implies q_1 = 14(1) + 1 = 15 = F_{16},\ q_2 = 14(18) + 2 = 254 = 15 * 16 + 14 = FE_{16},[/MATH]
[MATH]q_3 = 14(291) + 3 = 4077 = 3840 + 224 + 13 = 15 * 16^2 + 14 * 16 + 13 = FED_{16}.[/MATH]
Hexadecimal digits in reverse order.
In short, the first n - 1 q's can be expressed, in numerals to base n, in terms of descending digits starting with n - 1. Let's prove that.
[MATH]q_1 = (n - 2)p_1 + 1 = (n - 2)(1) + 1 = n - 2 + 1 = n - 1 = (n - 1)n^0 = \left ( \sum_{i=1}^1 (n - i) * n^{(1 - i)} \right ).[/MATH]
Thus, we can certainly say that, for any n > 2, there exists at least one positive integer j such that
[MATH]q_j = \left ( \sum{i=1}^j (n - i) * n^{(j-i)} \right ).[/MATH]
Moreover we can say in general that
[MATH]p_j(n - 2) + j = q_j \implies p_j = \dfrac{q_j - j}{n - 2}.[/MATH]
It was important to restrict n > 2.
[MATH]\therefore p_{j+1} = np_j + (j + 1) = \dfrac{nq_j - nj}{n - 2} + j + 1.[/MATH]
[MATH]\therefore q_{j+1} = (n - 2)p_{j+1} + (j +1) = (n - 2) \left ( \dfrac{nq_j - nj}{n - 2} + j + 1 \right ) + j + 1 =[/MATH]
[MATH]nq_j - nj + (n - 2)(j + 1) + (j + 1) = nq_j - nj + nj + n - 2j - 2 + j + 1 = nq_j + n - 1 - j = nq_j + \{n - (j + 1)\}=[/MATH]
[MATH]n \left ( \sum_{i=1}^j (n - i) * n^{(j-i)} \right ) + \{n - (j + 1)\} = \left ( \sum_{i=1}^j (n - i) * n^{\{(j+1)-i\}} \right ) + \{n - (j + 1)\} * n^\{(j+1)-(j+1)\} =[/MATH]
[MATH]\left ( \sum_{i=1}^{j+1} (n - i) * n^{\{(j+1)-i\}} \right ).[/MATH]
So, by induction, [MATH]q_k = \left ( \sum_{i=1}^k (n - i) * n^{(k-i)} \right ).[/MATH]
But that is how we create base n notation.