Why do these relations hold ? Any underlying theorem/principle/rule/method ?
$ \sum_{k=1}^{n} k \cdot 10^{d(n-k)} \equiv \frac{n(n+1)}{2} \pmod{\text{rep}(1/n)} $
$ \sum_{k=1}^{n-1} k \cdot 10^{d(n-1-k)} \equiv \frac{n(n-1)}{2} \pmod{\text{rep}(1/n)} $
$ \sum_{k=0}^{n-1} k \cdot 10^{kd} + 10^{d(n-1)} \cdot \sum_{k=1}^{n} k \cdot 10^{d(n-k)} \equiv n^{2} \pmod{\text{rep}(1/n)} $
where:
$n$ is not a multiple of $2$ or $5$,
$n>1$,
$\text{rep}(1/n)$ is the repetend of $\frac{1}{n}$,
$\text{rep}(1/n) > 11$,
$d$ is the length or period of $\text{rep}(1/n)$.
Examples:
For $n=3$,
$\text{rep}(1/3)=3$ and $d=1$ because $\frac{1}{3}=0.\overline{3}$
But we need $\text{rep}(1/n) > 11$. So, we can extend it as follows:
$\text{rep}(1/3)=33$ and $d=2$ because $\frac{1}{3}=0.\overline{33}$.
Now, $ \sum_{k=1}^{3} k \cdot 10^{2(3-k)}=10203$
Also, $10203 \equiv \frac{3(3+1)}{2} \pmod{33}$
$\sum_{k=1}^{3} k \cdot 10^{2(3-1-k)}=102$
Also, $102 \equiv \frac{3(3-1)}{2} \pmod{33}$
$\sum_{k=0}^{3-1} k \cdot 10^{2k} + 10^{2(3-1)} \cdot \sum_{k=1}^{3} k \cdot 10^{2(3-k)} = 102030201$
Also, $102030201 \equiv 3^{2} \pmod{33}$
For $n=7$,
$\text{rep}(1/7)=142857$ and $d=6$ because $\frac{1}{7}=0.\overline{142857}$
Now, $ \sum_{k=1}^{7} k \cdot 10^{6(7-k)}=1000002000003000004000005000006000007$
Also, $1000002000003000004000005000006000007 \equiv \frac{7(7+1)}{2} \pmod{142857}$
$\sum_{k=1}^{7} k \cdot 10^{6(7-1-k)}=1000002000003000004000005000006$
Also, $1000002000003000004000005000006 \equiv \frac{7(7-1)}{2} \pmod{142857}$
$\sum_{k=0}^{7-1} k \cdot 10^{6k} + 10^{6(7-1)} \cdot \sum_{k=1}^{7} k \cdot 10^{6(7-k)} = 1000002000003000004000005000006000007000006000005000004000003000002000001$
Also, $1000002000003000004000005000006000007000006000005000004000003000002000001 \equiv 7^{2} \pmod{142857}$
For $n=9$,
$\text{rep}(1/9)=1$ and $d=1$ because $\frac{1}{9}=0.\overline{1}$
But we need $\text{rep}(1/n) > 11$. So, we can extend it as follows:
$\text{rep}(1/9)=111$ and $d=3$ because $\frac{1}{9}=0.\overline{111}$.
Now, $ \sum_{k=1}^{9} k \cdot 10^{3(9-k)}=1002003004005006007008009$
Also, $1002003004005006007008009 \equiv \frac{9(9+1)}{2} \pmod{111}$
$\sum_{k=1}^{9} k \cdot 10^{3(9-1-k)}=1002003004005006007008$
Also, $1002003004005006007008 \equiv \frac{9(9-1)}{2} \pmod{111}$
$\sum_{k=0}^{9-1} k \cdot 10^{3k} + 10^{3(9-1)} \cdot \sum_{k=1}^{9} k \cdot 10^{3(9-k)} = 1002003004005006007008009008007006005004003002001$
Also, $1002003004005006007008009008007006005004003002001 \equiv 9^{2} \pmod{111}$
For $n=11$,
$\text{rep}(1/11)=09$ and $d=2$ because $\frac{1}{11}=0.\overline{09}$
But we need $\text{rep}(1/n) > 11$. So, we can extend it as follows:
$\text{rep}(1/11)=0909$ and $d=4$ because $\frac{1}{11}=0.\overline{0909}$.
Now, $ \sum_{k=1}^{11} k \cdot 10^{4(11-k)}=10002000300040005000600070008000900100011$
Also, $10002000300040005000600070008000900100011 \equiv \frac{11(11+1)}{2} \pmod{0909}$
$\sum_{k=1}^{11} k \cdot 10^{4(11-1-k)}=1000200030004000500060007000800090010$
Also, $1000200030004000500060007000800090010 \equiv \frac{11(11-1)}{2} \pmod{0909}$
$\sum_{k=0}^{11-1} k \cdot 10^{4k} + 10^{4(11-1)} \cdot \sum_{k=1}^{11} k \cdot 10^{4(11-k)} = 100020003000400050006000700080009001000110010000900080007000600050004000300020001 $
Also, $100020003000400050006000700080009001000110010000900080007000600050004000300020001 \equiv 11^{2} \pmod{0909}$
For $n=13$,
$\text{rep}(1/13)=076923$ and $d=6$ because $\frac{1}{13}=0.\overline{076923}$
Now, $ \sum_{k=1}^{13} k \cdot 10^{6(13-k)}=1000002000003000004000005000006000007000008000009000010000011000012000013$
Also, $1000002000003000004000005000006000007000008000009000010000011000012000013 \equiv \frac{13(13+1)}{2} \pmod{076923}$
$ \sum_{k=1}^{13} k \cdot 10^{6(13-1-k)}=1000002000003000004000005000006000007000008000009000010000011000012$
Also, $1000002000003000004000005000006000007000008000009000010000011000012\equiv \frac{13(13-1)}{2} \pmod{076923}$
$\sum_{k=0}^{13-1} k \cdot 10^{6k} + 10^{6(13-1)} \cdot \sum_{k=1}^{13} k \cdot 10^{6(13-k)} = 1000002000003000004000005000006000007000008000009000010000011000012000013000012000011000010000009000008000007000006000005000004000003000002000001 $
Also, $1000002000003000004000005000006000007000008000009000010000011000012000013000012000011000010000009000008000007000006000005000004000003000002000001 \equiv 13^{2} \pmod{076923}$