18

I am finding a 4-digit number $abcd$ (in base-10 representation) satisfying the following property.

$$abcd=a^b c^d$$

I have been running my mind around this problem since a long time, but got no success.

I wrote a python program for a number with this property, and got the answer to be $2592$ since

$$2592=2^5\times 9^2$$

But I am looking for a purely mathematical way to solve this problem.

Thanks!

Jaideep Khare
  • 19,551
  • 3
    Here is a related question, I don't know how helpful it is. You might want to look up the published solution to American Mathematical Monthly problem E69 (vol. 41, May 1934, p. 322) and see how "mathematical" it is. – bof Nov 05 '17 at 04:57
  • 1
    Historical note: this is question 115 in H E Dudeney, Amusements in Mathematics, available at https://www.gutenberg.org/files/16713/16713-h/16713-h.htm – Gerry Myerson Nov 05 '17 at 05:57
  • 1
    @GerryMyerson The reference to Dudeney and a link to the text of his Amusements in Mathematics were also provided in my answer to the "related question" that I linked to in my comment. – bof Nov 07 '17 at 11:43

2 Answers2

13

We want to find integers $a,b,c,d$ such that $$1000a+100b+10c+d=a^bc^d\tag0$$ $$1\le a\le 9,\quad 0\le b\le 9,\quad 0\le c\le 9,\quad 0\le d\le 9$$

We use the followings (the proofs are written at the end of the answer) :

$(1)$ $c\not=0,1$

$(2)$ $d\not=0$

$(3)$ $b\not=0,1$

$(4)$ $a\not=1$

$(5)$ $d\not=1$

$(6)$ $c^d\le 2499$

$(7)$ If $d$ is odd, then $a,c$ have to be odd. If $d$ is even, then either $a$ or $c$ has to be even.

$(8)$ $(c,d)\equiv (0,0),(1,1),(1,2),(1,3),(2,0),(3,1),(3,2),(3,3)\pmod 4$

$(9)$ If $c=5$, then $d=5$.

$(10)$ If $a^b\equiv 2,3\pmod 5$ with $a$ even, then $a=2,8$.

$(11)$ If $a^b\equiv 2,3\pmod 5$ with $a$ odd, then $a=3,7$.

$(12)$ If $a^b\equiv 4\pmod 5$ with $a$ even, then $a=2,4,8$.

$(13)$ If $a^b\equiv 4\pmod 5$ with $a$ odd, then $a=3,7,9$.

From $(1)(2)(5)(6)(8)(9)$, we see that $(c,d)$ has to be either $$(4,4),(9,2),(9,3),(2,4),(2,8),(6,4),(3,2),(3,6),(7,2),(3,3),(3,7),(7,3),(3,5)$$ Here, let us separate it into cases and use $(3)(4)(7)(10)(11)(12)(13)$.

  • Case 1 : If $(c,d)=(4,4)$, then we have $250a+25b+11=64a^b$. So, $b$ has to be odd. Also, we have $4\equiv a^b4^4\pmod{10}\implies a^b\equiv 4,9\pmod{10}$ from which $(a,b)=(4,3),(4,5),(9,3)$ follow. However, these do not satisfy $a^b\le\frac{9999}{4^4}=39+\frac{15}{256}$.

  • Case 2 : If $(c,d)=(9,2)$, then we have $a+b+11\equiv a^b9^2\equiv 0\pmod 9\implies b\equiv 7-a\pmod 9$, and $a^b\equiv 2\pmod{10}$. Also, from $(4)(7)$, $a=2,8$. These imply $(a,b)=(2,5)$, and then the equation $(0)$ holds.

  • Case 3 : If $(c,d)=(9,3)$, then from $(7)(11)$, we have $a=3,7$. We also have $b\equiv 6-a\pmod 9$ from which $(a,b)=(3,3)$ follows. However, this does not satisfy $a^b\le\frac{9999}{9^3}=13+\frac{522}{729}$.

  • Case 4 : If $(c,d)=(2,4)$, then we have $250a+25b+6=4a^b$. So, $b$ has to be even. We also have $a^b\le\frac{9999}{2^4}=624+\frac{15}{16}$ and $a^b\equiv 4,9\pmod{10}$ from which $(a,b)=(2,2),(2,6),(3,2),(7,2),(8,2)$ follow. Also, we have to have $a+b\equiv a^b\pmod 3$ which does not hold for $(a,b)=(2,6),(3,2),(7,2)$. Finally, for $(a,b)=(2,2),(8,2)$, the equation $(0)$ does not hold.

  • Case 5 : If $(c,d)=(2,8)$, then we have $a^b\le\frac{9999}{2^8}=39+\frac{15}{256}$ and $a^b\equiv 3,8\pmod{10}$. These imply $(a,b)=(2,3)$ for which $a+b+1\equiv a^b\pmod 3$ does not hold.

  • Case 6 : If $(c,d)=(6,4)$, then we have $b\equiv 8-a\pmod 9$ and $a^b\equiv 4,9\pmod{10}$ from which $(a,b)=(2,6)$ follows. However, this does not satisfy $a^b\le\frac{9999}{6^4}=7+\frac{927}{1296}$.

  • Case 7 : If $(c,d)=(3,2)$, then, from $(7)(10)$, $a=2,8$. Also, we have $b\equiv 4-a\pmod 9$ from which $(a,b)=(2,2)$ follows. However, this does not satisfy $a^b\equiv 7\pmod{10}$.

  • Case 8 : If $(c,d)=(3,6)$, then, from $(7)(12)$, $a=2,4,8$. Also, we have $b\equiv 9-a\pmod 9$ and $a^b\equiv 4\pmod{10}$ from which $(a,b)=(4,5)$ follows. However, this does not satisfy $a^b\le\frac{9999}{3^6}=13+\frac{522}{729}$.

  • Case 9 : If $(c,d)=(7,2)$, then, from $(7)(10)$, $a=2,8$. Also, we have $a^b\equiv 8\pmod{10}$ from which $(a,b)=(2,3),(2,7)$ follow. However, for each case, the equation $(0)$ does not hold.

  • Case 10 : If $(c,d)=(3,3)$, then, from $(7)(13)$, $a=3,7,9$. Also, we have $b\equiv 12-a\pmod 9$ from which $(a,b)=(9,3)$ follows. However, this does not satisfy $a^b\le\frac{9999}{3^3}=370+\frac{1}{3}$.

  • Case 11 : If $(c,d)=(3,7)$, then we have $b\equiv 8-a\pmod 9$ and $a^b\equiv 1\pmod{10}$. There are no such $(a,b)$.

  • Case 12 : If $(c,d)=(7,3)$, then we have $a^b\equiv 1\pmod{10}$ from which $(a,b)=(3,4),(3,8),(7,4),(9,2),(9,4)$ follow. However, these do not satisfy $a^b\le\frac{9999}{7^3}=29+\frac{52}{343}$.

  • Case 13 : If $(c,d)=(3,5)$, then, from $(7)(11)$, $a=3,7$. Also, we have $b\equiv 10-a\pmod 9$ from which $(a,b)=(3,7),(7,3)$ follow. However, these do not satisfy $a^b\le\frac{9999}{3^5}=41+\frac{36}{243}$.

Therefore, $\color{red}{(a,b,c,d)=(2,5,9,2)}$ is the only solution.


Finally, let us prove $(1),(2),\cdots,(13)$.

$(1)$ $c\not=0,1$

Proof : If $c=0$, then $1000a+100b+1=0$ is not a four-digit number.

If $c=1$, then $a^{b-1}=1000+\frac{100b+10+d}{a}$ which implies $1000+\frac{10}{9}\le a^{b-1}\le 1919=1000+\frac{919}{1}$. So, $(a,b)=(4,6),(6,5)$. For each case, there is no such integer $d$. $\quad\blacksquare$

$(2)$ $d\not=0$

Proof : If $d=0$, then $1000a+100b+10c=a^b$ implies $10\mid a$ which is impossible. $\quad\blacksquare$

$(3)$ $b\not=0,1$

Proof : If $b=0$, then $1000a+10c+d=c^d$ implies $d\equiv c^d\pmod{10}$ which gives $(c,d)=(1,1),(7,3),(5,5),(4,6),(6,6),(3,7),(9,9)$. For each case, there is no such $a$.

If $b=1$, then $1000+\frac{100+10c+d}{a}=c^d$ which implies $1013+\frac{4}{9}=1000+\frac{121}{9}\le c^d\le 1000+\frac{199}{1}=1199$. So, we have $(c,d)=(4,5)$, but there is no such $a$. $\quad\blacksquare$

$(4)$ $a\not=1$

Proof : If $a=1$, then we have $1000+100b+10c+d=c^d$ which gives $1212\le c^d\le 1999$. So, we have $(c,d)=(6,4)$, but there is no such $b$. $\quad\blacksquare$

$(5)$ $d\not=1$

Proof : If $d=1$, then $a^{b-1}=\frac{1000a+100b+10c+1}{ca}$ which gives $27+\frac{34}{81}=\frac{2221}{9^2}\le a^{b-1}\le\frac{9991}{2^2}=2497+\frac 34$. So, $$\begin{align}(a,b)=&(2,6),(2,7),(2,8),(2,9),(3,5),(3,6),(3,7),(3,8),(4,4),(4,5),(4,6),\\&(5,4),(5,5),(6,3),(6,4),(6,5),(7,3),(7,4),(8,3),(8,4),(9,3),(9,4).\end{align}$$ For each case, there is no such integer $c$. $\quad\blacksquare$

$(6)$ $c^d\le 2499$

Proof : $c^d=\frac{1000a+100b+10c+d}{a^b}\le\frac{9999}{2^2}=2499+\frac 34$. $\quad\blacksquare$

$(7)$ If $d$ is odd, then $a,c$ have to be odd. If $d$ is even, then either $a$ or $c$ has to be even.

Proof : Since $b,d\not=0$, we have $a^bc^d\equiv ac\pmod 2$. So, $d\equiv 1000a+100b+10c+d\equiv a^bc^d\equiv ac\pmod 2$. $\quad\blacksquare$

$(8)$ $(c,d)\equiv (0,0),(1,1),(1,2),(1,3),(2,0),(3,1),(3,2),(3,3)\pmod 4$

Proof : We have $2c+d\equiv a^bc^d\pmod 4$. For $(c,d)\equiv (0,1),(0,2),(0,3)$, we have $d\equiv 0$ which is impossible. For $(c,d)\equiv (1,0),(3,0)$, we have $2\equiv a^b$ which is impossible since we already have $b\not=1$. For $(c,d)\equiv (2,2),(2,3)$, we have $2\ \text{or}\ 3\equiv 0$ which is impossible. Also, $(c,d)\equiv (2,1)$ is impossible from $(7)$. $\quad\blacksquare$

$(9)$ If $c=5$, then $d=5$.

Proof : We have $d\equiv a^bc^d\pmod 5$. If $c=5$, then $d\equiv 0\pmod 5$. $\quad\blacksquare$

$(10)$ If $a^b\equiv 2,3\pmod 5$ with $a$ even for some $b$, then $a=2,8$.

Proof : If $a=4$, then $a^b\equiv (-1)^b\equiv 1,4\pmod 5$ for any $b\ge 2$. If $a=6$, then $a^b\equiv 1\pmod 5$ for any $b\ge 2$. $\quad\blacksquare$

$(11)$ If $a^b\equiv 2,3\pmod 5$ with $a$ odd for some $b$, then $a=3,7$.

Proof : If $a=5$, then $a^b\equiv 0\pmod 5$ for any $b\ge 2$. If $a=9$, then $a^b\equiv (-1)^b\equiv 1,4\pmod 5$ for any $b\ge 2$. $\quad\blacksquare$

$(12)$ If $a^b\equiv 4\pmod 5$ with $a$ even for some $b$, then $a=2,4,8$.

Proof : If $a=6$, then $a^b\equiv 1\pmod 5$ for any $b\ge 2$. $\quad\blacksquare$

$(13)$ If $a^b\equiv 4\pmod 5$ with $a$ odd for some $b$, then $a=3,7,9$.

Proof : If $a=5$, then $a^b\equiv 0\pmod 5$ for any $b\ge 2$. $\quad\blacksquare$

mathlove
  • 151,597
  • 2
    Wow. Thanks for your answer @mathlove! (+1) It's very nice answer since it covers all cases. Though, it's quite lengthy and may be that there is no other short way to solve this problem. I'll award this answer the bounty but let me wait if any other shorter solution is possible (even if someone else comes up with better solution, I'll award this answer additional bounty, because it deserves!). – Jaideep Khare Nov 08 '17 at 12:21
2

I will type up the answer provided in the published solution for posterity.

From the American Mathematical Monthly problem E$69$ (Vol. $41$, May $1934$, p. $322$)

(accessed via JSTOR)

Instead of a product of powers, $a^bc^d$, a printer accidentally prints the four-digit number, $abcd$. The value is however the same. Find the number and show that it is unique.

  1. Since $abcd = a^bc^d$, neither $a^b$ nor $c^d$ can have more than four digits. Hence the highest possible powers for any single digits in the problem are $9^4$, $8^4$, $7^4$, $6^5$, $5^5$, $4^6$, $3^8$, $2^9$, and $1^9$ $2.$
  2. Neither $a$ nor $c$ is zero, as that would make $abcd$ zero
  3. If $a=1$, or if $b=0$, then $abcd = c^d$. Similarly, if $c=1$ or $d=0$, then $abcd = a^b$. Examination of the expanded powers which have four digits shows that none meets these conditions. Therefore $a \not =1$, $b \not = 0$, $ c \not = 1$, and $d \not =0$.
  4. If one of $a^b$ and $c^d$ has four digits, the other is less than ten and so must be $n^1$, $2^2$, $2^3$, or $3^2$. But no product of an eligible four digits expanded power by any one of these numbers meets condition (1), so these possibilities are accordingly ruled out.
  5. Since $abcd$ cannot end in zero, and since neither $a$ nor $c$ is one, $2000 \lt abcd \lt 10,000$.
  6. A test of the possible products formable from the remaining eligible expanded factors by multiplying the units digits and noting that the resultant units digits is not the same as either exponent, eliminates the majority of possibilities. Complete multiplication disposes of all others except $2^5 \cdot 9^2 = 32 \cdot 81 = 2592$, which is therefore the unique solution.
John Lou
  • 2,436
  • Still, not quite a math solution, rather trial and error. Since this is about four-digit numbers only, the computer program indeed can look up all solutions. I would put it in a more generic way: Find all 2n-digit numbers $a_1 a_2 ... a_{2n};$ equal to $a_1^{a_2}a_3^{a_4}...a_{2n-1}^{a_{2n}}$. – cyanide Nov 05 '17 at 06:56
  • Using a program, until $n=4$, I have the sole solution as $2592$ – John Lou Nov 05 '17 at 21:44
  • 4
    Please GIVE THE SOURCE of your quotation. Presumably you're quoting from the American Mathematical Monthly issue I cited in my comment, but please SAY SO EXPLICITLY as your answer is permanent but the comment is temporary. – bof Nov 07 '17 at 11:41
  • 2
    @cyanide Of course it's a "math solution". Mathematical solution methods include "trial and error". You can ask for a more elegant solution. Inasmuch as the answer published in the American Mathematical Monthly was selected by the Problems and Solutions editor from the six correct solutions that were submitted, I suspect this solution may be as elegant as it gets. – bof Nov 07 '17 at 11:49
  • @bof will do, thanks. – John Lou Nov 07 '17 at 15:14
  • 1
    John Lou. I tried to go for bigger n-s. With first 4 works pretty fast, but starting with n=5 (10 digits) it takes ages and the computer fan goes mad:) Still have only 2592 with n up to 5, with n=6 I'm just waiting for it to finish. Unfortunately I can't go further as 64 bits unsigned has a 4G limit, while with BigNumbers class, you really need a supercomputer ;) – cyanide Nov 16 '17 at 05:08
  • @cyanide if after 7 years you are still interested in this problem, I have posted this generalisation https://math.stackexchange.com/questions/5039759/generalising-2592 – Benjamin Wang Feb 26 '25 at 10:16
  • Thanks indeed. However, as far as I can see, there are no other solutions apart from a controversial one assuming $0^0=1$. However, Wolfram Math suggests a broader generalisation, bringing additional solutions: $3^4 \cdot 425 = 34425$ and $31^2 \cdot 325 = 312325$. – cyanide Jun 03 '25 at 12:02