Showing posts with label simultaneous equations. Show all posts
Showing posts with label simultaneous equations. Show all posts

Tuesday, 23 September 2025

Obscure Difference of Two Squares

 Here's an interesting problem that appeared in this YouTube video:

Find the values of \(a, b \in \mathbb{N}\) such \(a^b-b=77\).

With two unknowns and only one equation, the problem seems daunting but the factorisation of 77 and the fact that the values of \(a\) and \(b\) are restricted to natural numbers will be enough to solve the problem. However, the solution that the video describes hinges on the use of a difference of two squares and this is not at all obvious. Let's begin:$$ \begin{align} a^b-b &= 77 \\ (a^{b/2})^2-(\sqrt{b})^2 &= 77 \\ (a^{b/2}-\sqrt{b}) \times  (a^{b/2}+\sqrt{b}) &= 7 \times 11 \end{align} $$We know that \(a^{b/2}-\sqrt{b} < a^{b/2}+\sqrt{b}\) and so there are only two possible factorisations of 77. These are \(1 \times 77\) and \(7 \times 11 \). Not only is the second option more likely but the first option in fact does not yield a solution, as we'll show later. Let's proceed using the \(7 \times 11\) factorisation.$$ \begin{align} a^{b/2}-\sqrt{b} &=7 \dots 1\\ a^{b/2}+\sqrt{b} &=11 \dots 2 \end{align}$$Adding equations 1 and 2 together gives:$$ \begin{align} 2 a^{b/2} &=18 \\ a^{b/2} &=9 \\ \end{align}$$Let's substitute \(a^{b/2}=9\) back in the equation 1:$$ \begin{align} 9 - \sqrt{b} &= 7 \\ \sqrt{b} &= 2 \\ b &=4 \\ \because a^{b/2} &= 9 \\ a^2 &= 9 \\ a&=3 \end{align}$$So we have a solution with \(a = 3\) and \(b=4\). Substituting these values back into the original equation should confirm the solution:$$ \begin{align} a^b -b &= 77 \\ 3^4-4 &=77\\77 &= 77 \end{align}$$But what of the \(1 \times 77\) factorisation? Let's confirm that this does not yield a solution:$$ \begin{align} a^{b/2}-\sqrt{b} &=1 \dots 1\\ a^{b/2}+\sqrt{b} &=77 \dots 2 \end{align}$$Adding equations 1 and 2 together gives$$ \begin{align} 2a^{b/2} &=78\\ a^{b/2} &= 39 \end{align}$$Substitute \(a^{b/2}=39\) back in the equation 1:$$ \begin{align} 39 - \sqrt{b} &=77 \\ \sqrt{b}=-38 \end{align}$$There is no value of \(b\) that satisfies this equation so we can confirm that the \(1 \times 77\) factorisation does not yield a solution. I did not think up the method of solution described here and all credit is due the author of the linked video. It did occur to me to generalise the problem and consider what other biprimes (or semiprimes) yield a solution. In other words, what prime values of \(x\) and \(y\), with \(x<y\), allow for natural number solutions to:$$a^b-b=xy$$The two equations we obtain from this relationship are:$$ \begin{align} a^{b/2}-\sqrt{b} &=x \dots 1\\ a^{b/2}+\sqrt{b} &=y \dots 2 \end{align}$$Adding equations 1 and 2 gives:$$ \begin{align} 2a^{b/2} &= x+y \\ a^{b/2} &= \frac{x+y}{2} \end{align}$$Substituting into equation 1 gives:$$ \begin{align} \frac{x+y}{2}-\sqrt{b} &= x \\ \sqrt{b} &= \frac{x+y}{2}-x \\ \sqrt{b} &= \frac{x+y-2x}{2} \\ b &= \frac{(y-x)^2}{4}  \end{align}$$Testing this equation with \(x=7\) and \(y=11\) we see that \(b=4\) and so all is well. So what other prime values of \(x\) and \(y\) will yield solutions? Testing we find that \(x=3\) and \(y=5\) yield a value of \(b=1\). This leads to:$$ \begin{align} a^{b/2} &=\frac{x+y}{2}\\ \sqrt{a} &= 4 \\ a &=16 \end{align}$$Checking, we see that:$$ \begin{align} a^b-b &=15 \\ 16^1-1 &=15\\15 &= 15 \end{align}$$Rather than randomly checking prime values of \(x\) and \(y\), the design of a search algorithm is a more organised approach (permalink). Let's exclude those cases where either \(a=1\) or \(b=1\) as these are rather trivial. For semiprimes with prime factors less than 300, I found the following additional semiprimes (the calculations are very processor intenstive). The first is 6557:$$ \begin{align} 6557 &=79 \times 83 \\ \text{with } a &= 9 \text{ and }b= 4 \end{align}$$Checking, we find that:$$ \begin{align} a^b-b &= 6557 \\9^4 - 4 &= 6557 \\ 6561-4  &= 6557\\ 6557&=6557 \end{align}$$The second is 50621:$$ \begin{align} 50621 &=223 \times 227\\ \text{with } a &= 15 \text{ and }b= 4 \end{align}$$Checking, we find that:$$ \begin{align} a^b-b &= 50621 \\ 15^4 - 4 &= 50621\\50625-4 &= 50621\\50621 &= 50621 \end{align}$$The third is 194477:$$ \begin{align} 194477 &=439 \times 443 \\ \text{with } a &= 21 \text{ and } b=4 \end{align}$$Checking, we find that:$$ \begin{align} a^b-b &= 194477 \\ 21^4-4 &= 194477 \\ 194481-4 &= 194477 \\ 194477 &= 194477 \end{align}$$That's probably enough. As can be seen, the semiprimes that satisfy are few and far between but it was an interesting exercise. Notice that the prime factors in each case are adjacent primes.

Wednesday, 14 December 2022

Two Equations, Two Unknowns and the Beta Function

I spotted this little problem on Twitter (see Figure 1):


Figure 1

The proximity of \(+31\) to \(+32\) should alert us to the possibility that either \(x=+2\) or \(y=+2\) is a solution. After that, the corresponding \(x\) and \(y\) values fall into place. However, let's suppose that we didn't spot this and I have to confess I didn't. In that case, we follow the conventional method. 

At first sight, it looks like you will end up with a quintic equation after substituting \(y=1-x\) into \(x^5+y^5=31\) and there is no general formula for solving quintic equations. However, the \(x^5\) terms cancels out nicely leaving us with a quartic equation. Let's see how:$$\begin{align} x^5+(1-x)^5&=31\\x^5+(1-5x+10x^2-10x^3+5x^4-x^5)&=31\\5x^4-10x^3+10x^2-5x-30&=0\\5x^3(x-2)+5(2x^2-x-6)&=0\\5x^3(x-2)+5(2x+3)(x-2)&=0\\(x-2)(5x^3+10x+15)&=0\\5(x-2)(x^3+2x+3)&=0\\5(x-2)(x+1)(x^2-x+3)&=0 \end{align}$$Thus \(x=2\) and \(y=-1\) or \(x=-1\) and \(y=2\). Using GeoGebra, this can be confirmed visually as shown in Figure 2:


Figure 2

Differentiation reveals a little more about the graph of \(x^5+y^5=31\):$$\begin{align} y'&=\frac{-x^4}{y^4}\\&=-\frac{x^4}{\sqrt[5]{31-x^5}} \end{align} $$It can be seen that \(y'\) is undefined when \(x=\sqrt[5]{31} \approx 1.9873 \) and thus the graph is vertical at this point. If we zoom in a little, this becomes clearer (see Figure 3). There is a point of horizontal inflection when \(x=0\).


Figure 3

This was a useful little exercise as I got to revisit the binomial expansion for \( (a+b)^5\) and the factor theorem in order to factorise \(x^3+2x+3\). Using 1 rather than 31, I was also prompted to consider the area under the curve for \( x^5+y^5 =1\) between 0 and 1. See Figure 4.


Figure 4

In this graph, the vertical tangent occurs at \(x=1\) and this got me thinking about the area under the curve between 0 and 1. In other words, what is the value of:$$ \int_0^1 \sqrt[5]{1-x^5} \, dx$$Using SageMathCell, the integral evaluates to:$$ 0.2 \cdot \beta \! \left (0.2, 1.2 \right )$$Now I vaguely remember coming across a so-called \( \beta \) function that is in some way, I think, related to the \(\Gamma \) function. Further investigation revealed that they are indeed related. In fact:$$ 0.2 \cdot \beta(0.2, 1.2)= 0.2 \cdot \frac{ \Gamma(0.2) \cdot \Gamma(1.2)}{ \Gamma(0.2 +1.2)} \approx 0.950150138988437 $$This result looks about right but what is going on with this \( \beta \) function? Well, the beta function is actually an integral between 0 and 1 involving two different values, let's say \(a\) and \(b\), so that we have:$$\beta(a,b)=\int_0^1 t^{a-1} \cdot (1-t)^{b-1} dt$$If we can get our integral into that form then we can integrate it. Firstly, we make a substitution. Let \(t=x^5\) and so \(dt/dx=5x^4\) and \(dx=0.2 x^{-4}\). We can write \(x^{-4}=t^{-0.8}\) and the integral now transforms into:$$ \begin{array} \displaystyle \displaystyle \int_0^1 \sqrt[5]{1-x^5} \, dx &=\text{0}.2 \displaystyle \int_0^1 t^{-0.8} (1-t)^{0.2} \, dt \\&=0.2 \displaystyle \int_0^1 t^{0.2-1} (1-t)^{1.2-1} \, dt\\&=0.2 \, \beta(0.2,1.2) \end{array} $$So this was quite an interesting post that led me in some unexpected directions. I also was interested in the area between the curves \(x^2+y^2=1\) and \(x^5+y^5=1\) in the range from 0 to 1. See Figure 5 where eq2 is \(x^2+y^2=1\) and the curve \(x^5+y^5=1\) is a tangent to the circle at \(x=0\) and \(x=1\).


Figure 5

Clearly, the area between the two curves from \(x=0 \text{ to }1\) is given by \( \beta(0.2,1.2) - \dfrac{\pi}{4} \). What I've learned from all this is that the \(\beta\) function is a very useful tool to have in one's integration armoury.