Mamma Mia! Here We Go Again

How many ordered pairs of positive integers ( A , B ) (A,B) , each of which are between 1 and 100 inclusive, are there such that

A B = B A ? A^B = B^A ?


The answer is 102.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

7 solutions

Antony Diaz
May 15, 2014

First, we have that:

A B = B A log A B A = B A log A B = B log A B = B A { A }^{ B }={ B }^{ A }\\ \hookrightarrow \log _{ A }{ { B }^{ A } } =B\\ \quad \quad A\cdot \log _{ A }{ { B } } =B\\ \quad \quad \log _{ A }{ { B } } =\frac { B }{ A }

Now, if B = A n B={ A }^{ n } ,where n is a natural number n > 0 n>0

log A A n = A n A n = A n 1 \quad \quad \log _{ A }{ { { A }^{ n } } } =\frac { { A }^{ n } }{ A } \\ n={ A }^{ n-1 }

So, if n = 1 n=1 , we have that A = B A=B which gives 100 solutions.

If n = 2 n=2 , we have ( 2 , 4 ) a n d ( 4 , 2 ) (2,4) and (4,2) .

If n > 2 n>2 we don't have any solutions.

Thus, we have 102 solutions.

there are no solutions for n>2 ,this can be proved by Fermat's last theorem maybe

Murlidhar Sharma - 7 years ago

It is true that there are no solutions for n>2. But can u prove it please..

Vighnesh Raut - 7 years ago

Log in to reply

Look that A = n n 1 A=\sqrt [ n-1 ]{ n } .

Antony Diaz - 7 years ago

Log in to reply

I proved it using induction on the exponent.

Anupam Nayak - 5 years, 6 months ago

Log in to reply

@Anupam Nayak Could show your proof to us??

Puneet Pinku - 5 years ago

How is it proved from the above equation that it is not true for n>2.

Puneet Pinku - 5 years ago

I can prove it, but no margin

bill wang - 5 years ago

Log in to reply

Send a photo of it.

Puneet Pinku - 5 years ago

better than mine,I used lnx .

Fninja Robin - 7 years ago

Why should B = A n B=A^n with n = B A n=\frac{B}{A} integer ?

Here's a proof.

Let B A B\geq A , and let B = p i p r i m e p i m i \displaystyle B=\!\!\!\prod_{p_i \mathrm{prime}} p_i^{m_i} and A = p i p r i m e p i n i \displaystyle A=\!\!\!\prod_{p_i \mathrm{prime}} p_i^{n_i} .

B A = p i m i p i n i = p i m i n i \displaystyle \frac{B}{A}=\frac{\prod p_i^{m_i}}{\prod p_i^{n_i}}=\prod p_i^{m_i-n_i} is an integer iif m i n i 0 i m_i-n_i\geq 0 \,\forall i .

B A = A B p i m i A = p i n i B m i A = n i B i \displaystyle B^A=A^B \Leftrightarrow\prod p_i^{m_iA}=\prod p_i^{n_iB} \Leftrightarrow m_iA=n_iB \,\forall i .

Then m i = n i B A i m_i=\frac{n_iB}{A} \,\forall i and so m i n i = n i B A A 0 \displaystyle m_i-n_i=n_i\frac{B-A}{A}\geq 0 .

Laurent Shorts - 5 years, 2 months ago

can we do it by watching the patterns closely in the no.s

akash deep - 7 years ago

A=B makes 100 then (2,4) is the only ORDERED pair I find For 101

Mark Sinsheimer - 7 years ago

Log in to reply

(4,2) is another ordered pair, different from (2,4) (this is what "ordered" means).

Andrea Palma - 5 years, 11 months ago

Lemma: B is a power of A: Proof: Suppose B is not a power of A then B has a prime factor that is not in A, Call this prime p, We note that B^A is a multiple of p but A^B is not. Hence B=A^n. We are asked to solve A^(A^n)=(A^n)^(A)=A^(nA) Now note that we need A^n=nA for A >= 2 (For A =1 B =1). For n =1 this statement is true for all A For n =2, A^2 =2A, A^2-2A=0. This implies A = 2 for A >=2 For n >=3 we need A^n-nA=0, or A(A^(n-1)-n)=0 or A^(n-1)-n =0 for A>=2. Note that A = n^(1/(n-1)) Now this result is atleast 2 and hence n>= 2^(n-1) which is false for n>= 3. Note that only solutions are (A,A), (2,2^2), and by symmetry (2^2,2). We let A run through 1 to 100 for 100 solutions and note that there are 2 additional solutions making a total of 102 solutions

Siddharth Iyer - 5 years, 9 months ago

Log in to reply

The argument you use in your proof is not sufficient.

Suppose B is not a power of A then B has a prime factor that is not in A.

Consider A=4 and B=8. It's obvious that B is not a power of A. But B doesn't have any prime factor that is not in A, as you claim in your proof.

Prasun Biswas - 5 years, 6 months ago

Log in to reply

To be more specific there are solutions only if B is a power of A

Siddharth Iyer - 5 years, 6 months ago

We know that A = B A=B is a trivial solution for all 1 A 100 1\leq A\leq 100 .

If A = 1 A=1 , we already know that B = 1 B=1 is the only possibility.

If A = 2 A=2 , we already know that B = 2 B=2 or B = 4 B=4 are the only possibilities.

Suppose A 3 A\geq 3 . Let f A ( x ) = A x x A f_A(x)=A^x-x^A and let's find B B such that f A ( B ) = 0 f_A(B)=0 .

f A ( m ) ( x ) = A x ln m ( A ) A ! ( A m ) ! x A m , 1 m A f_A^{(m)}(x)=A^x\ln^m(A)-\frac{A!}{(A-m)!}x^{A-m}, \, \forall \, 1\leq m\leq A and so f A ( A + 1 ) ( x ) = A x ln A + 1 ( A ) > 0 , x A f_A^{(A+1)}(x)=A^x\ln^{A+1}(A)>0, \, \forall x\geq A .

f A ( m ) ( x ) > 0 , x A a n d 1 m A f_A^{(m)}(x)>0, \, \forall \, x\geq A \, \mathrm{ and } \, 1\leq m\leq A : (by induction)

f A ( m ) ( A ) = A A ln m ( A ) A ! ( A m ) ! A A m > A A A m A A m = 0 f_A^{(m)}(A)=A^A\ln^m(A)-\frac{A!}{(A-m)!}A^{A-m}>A^A-A^m A^{A-m}=0 and as by induction ( f A ( m ) ) ( x ) = f A ( m + 1 ) ( x ) > 0 \left(f_A^{(m)}\right)'(x)=f_A^{(m+1)}(x)>0 , the m t h m^{\mathrm {th}} derivative is increasing from a positive value and is then positive x A \forall x\geq A .

As f A ( x ) > 0 , x A f_A'(x)>0, \, \forall\, x\geq A and f A ( A ) = 0 f_A(A)=0 , f A ( x ) > 0 , x > A f_A(x)>0, \, \forall \, x>A .

So B cannot be > A >A . But if B > 2 B>2 , then A B = B A B A = A B A^B=B^A \Leftrightarrow B^A=A^B and then A cannot be > B >B . So A = B A=B or B 2 B\leq 2 , but we have already found all those solutions.

Laurent Shorts - 5 years, 2 months ago

How can we prove that for n >2 there are no solutions. Please explain clearly and in detail..

Puneet Pinku - 5 years, 1 month ago

Why is 2 not the answer? Because A and B are two different variables which cannot take the same value as seen in c r y p t a r i t h m e t i c \large\ cryptarithmetic questions. So other 100 value should not be considered.

Vishal Yadav - 5 years, 7 months ago

Log in to reply

The problem does not state that the numbers have to be distinct. It asks for ordered pairs of integers, which allows for them to be equal. E.g. ( 1 , 1 ) (1, 1) is considered a point in the plane.

Calvin Lin Staff - 5 years, 7 months ago

Log in to reply

sir, what does cryptarithmetic question as used by genius VISHAL YADAV?

Manvendra Singh - 5 years, 5 months ago

Log in to reply

@Manvendra Singh Cryptogram - Problem Solving might be helpful.

Prasun Biswas - 5 years, 5 months ago
Wing Tang
Feb 13, 2016

We can try to give an analytical proof here. The motivation comes from A B = B A A 1 A = B 1 B A^B = B^A \Longleftrightarrow A^{\frac{1}{A}} = B^{\frac{1}{B}} .

For A = B A = B , both sides are equal, in which case there are 100 solutions. For A B A\neq B , we claim that only ( 2 , 4 ) and ( 4 , 2 ) (2,4) \text{ and } (4,2) are the solutions (no other ( A , B ) (A,B) can satisfy A 1 A = B 1 B A^{\frac{1}{A}} = B^{\frac{1}{B}} ). The following justifies this claim.

Proof : \textit{Proof}:

Let f ( x ) = x 1 x f(x) = x^{\frac{1}{x}} for x > 0 x > 0 .

By inspection, f ( 1 ) < f ( 2 ) = f ( 4 ) < f ( 3 ) f(1) < f(2) = f(4) < f(3) . Now differentiating f f w.r.t. x x yields

f ( x ) = x 1 x ( 1 ln x ) x 2 , \displaystyle f'(x) = \frac{x^{\frac{1}{x}}\left(1- \ln x\right)}{x^2},

which shows that f ( x ) > 0 f'(x) > 0 when x < e x < e , f ( x ) = 0 f'(x) = 0 when x = e x= e , and f ( x ) < 0 f'(x) < 0 when x > e x > e .

Hence f f is strictly increasing on ( 0 , e ] (0,e] and strictly decreasing on [ e , ) [e, \infty) . Then for positive integers m , n m,n with m > n > 4 > e m > n > 4 > e , we have f ( m ) < f ( n ) < f ( 4 ) = f ( 2 ) f(m) < f(n) < f(4) = f(2) . Now it remains to show that f ( m ) > f ( 1 ) = 1 f(m) > f(1) = 1 .

Suppose the contrary that f ( m ) = a 1 f(m) = a \leq 1 for some positive integer m > 4 m>4 . Then we find that m 1 m = a m = a m a 1 m^{\frac{1}{m}} = a \Longrightarrow m = a^m \leq a \leq 1 , a contradiction with the fact that m > 4 m > 4 .

Hence for positive integers m , n m,n with m > n > 4 m > n > 4 , we have

f ( 1 ) < f ( m ) < f ( n ) < f ( 4 ) = f ( 2 ) < f ( 3 ) f(1)< f(m) < f(n) < f(4) = f(2) < f(3) .

This, in turn, means that for every positive integer n > 4 n > 4 , there is no m Z + m\in \mathbb Z^+ , with m n m \neq n , such that f ( m ) = f ( n ) f(m) = f(n) , and hence this proves the claim. \Box{\ }

A^B = B^A. The equation is also equivalent to A^(B/A) = B and A | B for integral solutions. Let B = AK and so... A^K = AK. A = (AK)^(1/K), 1 = [A^([1-K]/K)][K^(1/K)] and so.... [A^(1-K)][K] = 1. Also equivalent to A^(K-1) = K. A = (K)^(1/(K-1)) which is integral when K =1 and K = 2. If K = 1, then A = B, so there are 100 ordered pairs of solutions. If K = 2, A = 2 and B = 4. (2,4) and (4,2) satisfies the equation. Hence, there are 102 ordered pairs of solutions.

But I thought that since the numbers are a and b, they need to be different......

Satvik Golechha - 7 years ago

Log in to reply

Yeah , me too....till almost I glanced the trick in it again :)

Krishna Ar - 7 years ago
Alec Piazza
May 7, 2020

My solution is really intuitive, no logs involved, just basic algebra.

We have that:

A B = B A A^{B} = B^{A}

Let's assume that B A B \geq A , so we must have that A divides B. This is the same as saying that:

B = k A B = kA with k k positive integer. As a consequence, substituting the previous relation, we get:

A k A = ( k A ) A A^{kA} = (kA)^{A}

then extracting the A-th root on both sides:

A k = k A A^{k}=kA which is of course: A k k A = 0 A^{k}-kA=0

For k = 1 k=1 we get A A = 0 A-A=0 , which is the case of A = B A=B corresponding to 100 couples ( A , A ) (A,A) .

For k = 2 k=2 we get A 2 2 A = 0 A^{2}-2A=0 , whose solutions are A = 0 A=0 which is not acceptable, and A = 2 A=2 corresponding to the couples ( 2 , 4 ) (2,4) and ( 4 , 2 ) (4,2) for the symmetry of the problem.

For k 3 k\geq 3 we still get A = 0 A=0 as the non-intersting solution and the absolute value of all remaining solutions equal to the ( k 1 ) (k-1) -root of k k which turn out to be irrational for every k 3 k\geq 3 .

We got 100 couples from the case k = 1 k=1 and 2 couples from the case k = 2 k=2 , for a grand total of 102 ordinate couples that satisfy the condictions of the problem.

Sam Reeve
Nov 25, 2015

If t=2 then a=2^2 and b=2^1, therefore a=4 and b=2, if t=1, the denominator becomes 0 producing infinity. If t>2 for example if t=3. Then we have 3^(3/2) which will not be an integer. Since t^(1/(t-1) ) cannot be an integer except for t=2

Lu Chee Ket
Oct 1, 2015

(1, 1)

(2, 2)

(2, 4)

(3, 3)

(4, 2)

(4, 4)

...

(100, 100)

Obviously, 100 + 2 = 102. I checked with computing for safety even though this may not be smart.

Answer: 102

I don't think this is a valid solution, because you simply listed the solutions. How do you know more solutions don't exist?

Mehul Arora - 4 years, 11 months ago
Kiran Bodkey
May 15, 2014

if A=B, we get 100 pairs, and other pairs obtain from (x^x)^x=x^(x^x). only 2^2 and 3^3 are < 101. so (A,B)=(2,4) and (3,27) Hence ans.102 . In between (4,2) and (27,3) are also possible ordered pairs. Correct answer will be 104

27^3= 3^9<3^27 , thus (3,27) doesn't satisfy the equation.

Samarpit Swain - 7 years ago

( x x ) x x x x (x^x)^x\neq x^{x^x}

Mursalin Habib - 7 years ago

27^3=3^9!!

Hậu Nguyễn - 7 years ago

yeah yeah.. I did mistake

kiran bodkey - 7 years ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...