An elementary number theory problem that involves the digits

85 Views Asked by At

The original problem is to find a number $N$ with five different digits, that is equal to the sum $N'$ of all $3$-permutations of its digits. I have actually found that the only solution is $35964$ this way:

Let $N=[abcde]$ be a number that meets the aforementioned property, and $S=a+b+c+d+e$ the sum of its digits. Then $N=[abc]+[abd]+\ldots$. In this sum, each digit occurs $\dfrac{5\cdot4\cdot3}5=12$ times at every slot. So $N=12\cdot(100+10+1)S=1332S$. Since $1332$ is a multiple of $9$, so they are $N$ and, hence, $S$. On the other hand, $0+1+2+3+4\le S\le9+8+7+6+5$, so $S$ is $18$ or $27$. For $S=18$ the property does not hold, and for $S=27$ it does.

Then, I thought that in that problem there were some 'arbitrary' parameters: the base of numeration ($b$), the number of digits of $N$ ($k\le b$) and the number of digits of the permutations ($t\le k$). The problem now becomes:

Find all $4$-uples of positive integers $(N,b,k,t)$ with $t\le k\le b\ge 2$ such that $N$ is written in base $b$ with $k$ different digits and $N$ is also the sum of the numbers that, written in base $b$, are the $t$-permutations of the digits of $N$.

There are trivial solutions. For example $N<b$ (that is, when the number has only one digit). There are also trivial 'non-sulutions', for example when $N$ is written with two digits: indeed, if $N=[\alpha\beta]=b\alpha+\beta$ ($\alpha\ge 1$), for $t=1$ it would imply that $b\alpha+\beta=\alpha+\beta$, which is impossible, and for $t=2$, $b\alpha+\beta=(b+1)(\alpha+\beta)$, which is also impossible. For $2\le t=k$, there are no solutions either, because one of the permutations is $N$ and there are $k!>1$ permutations, so $N'>N$.

In general, if $N$ has $k$ digits, $N=[\alpha_{k-1}\ldots\alpha_0]$, $S=\sum_{j=0}^{k-1}\alpha_j$ and $$N=\sum_{j=0}^{k-1}\alpha_jb^j$$ $$N'=S\frac{(k-1)!}{(k-t)!}\sum_{j=0}^{t-1}b^j$$ $$S\equiv N\pmod{b-1}$$ $$\sum_{j=0}^{k-1}j=\frac{k(k-1)}2\le S\le\frac{(2b-k-1)k}2=\sum_{j=0}^{k-1}(b-1-j)$$

but I don't find the tools to solve this Diophantine system.

I have found that $N'$ is a multiple of $t$ because $\dfrac{(k-1)!}{(k-t)!}$ is a product of $t$ consecutive integers.

Equaling $N$ and $N'$, we get $$\sum_{j=0}^{k-1}\alpha_jb^j=S\frac{(k-1)!}{(k-t)!}\sum_{j=0}^{t-1}b^j$$ and from the congruence, $$Sk\equiv St\frac{(k-1)!}{(k-t)!}\pmod{b-1},$$ so $b-1$ divides $S\dfrac{(k-1)!}{(k-t-1)!}$. Then $S\dfrac{(k-1)!}{(k-t-1)!}$ is a multiple of $\text{lcm}(t,b-1)$