[Math] Sum of digits of $a^b$ equals $ab$

conjecturesdecimal-expansionnumber theory

The following conjecture is one I have made today with the aid of computer software.

Conjecture:

Let $s(\cdot)$ denote the sum of the digits of $\cdot$ in base $10$. Then the only integer values $a,b>1$ that satisfy $$s(a^b)=ab$$ are $(2,2),(3,3),(3,6),(3,9)$ and $(3,27)$.

Remarks:

  • The number of digits of an integer $n$ is $1+\lfloor\log_{10}n\rfloor$ where $\lfloor\cdot\rfloor$ denotes the floor function. This means that $s(a^b)<9+9\lfloor b\log_{10} a\rfloor$ as each digit takes a value of at most $9$. From this plot it is evident that the equality will never hold for $a\ge 9$, after checking the first $21$ values of $b$. Therefore it suffices to consider $2\le a\le 8$.

  • I have excluded the case $b=1$ as it is trivial – it forces $a$ to be a single-digit integer.

  • In PARI/GP the code is given by mfun(b)={for(i=2,8,for(j=2,b,if(sumdigits(i^j,10)==i*j,print(i," ",j))));} and tests up to $b\le 10^6$ verify the above conjecture.

Aside:

  • The equation $s(ab)=a+b$ is much simpler to solve. From here, the upper bound $a\le 23$ is apparent and for these values of $a$, we can form the upper bound $b\le 22$ as there will be no solutions when the red line lies above the blue lines. This $23\times22$ grid can be computed through software and it is found that the only solutions are $$(a,b)=(2,2),(3,6),(6,3).$$ The similarity in the first two solutions with the conjectured solutions may only be coincidental.

Advances on this will be appreciated.

Best Answer

I like to crack numbers but this time I'll pass. It's highly unlikely that there is any other solution. I have created a few plots of function:

$$f(a)=s(a^b)-ab$$

...for $a=2,3,4,5,6,7,8$ and $b\in [1,4000]$. All these plots look the same. The function slides towards negative infinity in a pretty linear fashion, with very little variation from the straight line. If you accept bets, I can bet a house that there are no other solutions except small ones that you already listed.

Mathematica code:

For[a=2,a<=8,a++,DiscretePlot[Total[IntegerDigits[a^b,10]]-a*b,{b,2,4000},Filling->f,Joined->False] // Print]

$a=2$

enter image description here

$a=3$

enter image description here

$a=4$

enter image description here

$a=5$

enter image description here

$a=6$

enter image description here

$a=7$

enter image description here

$a=8$

enter image description here