Primes Written as a Difference of Powers

Find the smallest prime which cannot be written as

3 a 2 b |3^a-2^b|

where a a and b b are non-negative integers.


The answer is 41.

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.

1 solution

Nathan Ramesh
May 26, 2014

As Finn already showed, all primes up to 37 work. It is left to prove that 41 doesn't work.

One very important number theory rule is: "If you can't do anything, take mod everything!" -Nathan Ramesh 2014

Applying that rule to this problem there are two cases:

  • Case 1: 3 a 2 b = 41 3^a-2^b=41 .

It is clear that a 1 a\ge 1 , so we can safely say that 3 a 0 ( m o d 3 ) 3^a\equiv 0\pmod{3} . From here we can take ( m o d 3 ) \pmod{3} to get that 2 b 41 2 ( m o d 3 ) 2 b 1 ( m o d 3 ) -2^b\equiv 41\equiv 2\pmod{3}\implies 2^b\equiv 1\pmod{3} . Checking values of 2 b ( m o d 3 ) 2^b\pmod{3} we see that 2 b 1 ( m o d 3 ) b 0 ( m o d 2 ) 2^b\equiv 1\pmod{3}\iff b\equiv 0\pmod{2} . Thus we can set b = 2 k 2 b = 2 2 k = ( 2 k ) 2 b=2k\implies 2^b=2^{2k}=(2^k)^2 . Let's leave this aside for now and go back to our original equation. It is clear that b 2 b\ge 2 , so we can safely say that 2 b 0 ( m o d 4 ) 2^b\equiv 0\pmod{4} . From here we can take ( m o d 4 ) \pmod{4} to get that 3 a 41 1 ( m o d 4 ) 3^a\equiv 41\equiv 1\pmod{4} . Checking values of 3 a ( m o d 4 ) 3^a\pmod{4} we see that 3 a 1 ( m o d 4 ) a 0 ( m o d 2 ) 3^a\equiv 1\pmod{4}\iff a\equiv 0\pmod{2} . Thus we can set a = 2 j 3 a = 3 2 j = ( 3 j ) 2 a=2j\implies 3^a=3^{2j}=(3^j)^2 . Now we can see where we're getting. We have ( 3 j ) 2 ( 2 k ) 2 = 41 ( 3 j 2 k ) ( 3 j + 2 k ) = 41 (3^j)^2-(2^k)^2=41\implies (3^j-2^k)(3^j+2^k)=41 . Clearly, since 41 41 is prime and 3 j + 2 k 1 3^j+2^k\not=1 , we must have 3 j 2 k = 1 3^j-2^k=1 and 3 j + 2 k = 41 3^j+2^k=41 . Adding these equations and dividing by 2 2 gives 3 j = 21 3^j=21 which clearly isn't possible. Thus this case has no solutions. \square

  • Case 2: 2 b 3 a = 41 2^b-3^a=41 .

It is clear that a 1 a\ge 1 , so we can safely say that 3 a 0 ( m o d 3 ) 3^a\equiv 0\pmod{3} . From here we can take ( m o d 3 ) \pmod{3} to get that 2 b 41 2 ( m o d 3 ) 2^b\equiv 41\equiv 2\pmod{3} . Checking values of 2 b ( m o d 3 ) 2^b \pmod{3} we see that 2 b 2 ( m o d 3 ) b 1 ( m o d 2 ) 2^b\equiv 2\pmod{3}\iff b\equiv 1\pmod{2} . This will be important later, so keep it in mind. It is clear that b 2 b\ge 2 , so we can safely say that 2 b 0 ( m o d 4 ) 2^b\equiv 0\pmod{4} . From here we can take ( m o d 4 ) \pmod{4} to get that 3 a 41 1 ( m o d 4 ) 3 a 3 ( m o d 4 ) -3^a\equiv 41\equiv 1\pmod{4}\implies 3^a\equiv 3\pmod{4} . Checking values of 3 a ( m o d 4 ) 3^a\pmod{4} we see that 3 a 3 ( m o d 4 ) a 1 ( m o d 2 ) 3^a\equiv 3\pmod{4}\iff a\equiv 1\pmod{2} . Since we still aren't done, let's try another mod. Let's try 8 8 . We have 2 b 3 a 1 ( m o d 8 ) 2^b-3^a\equiv 1\pmod{8} . Values of 2 b ( m o d 8 ) 2^b\pmod{8} are 1 , 2 , 4 , 0 , 0 , 0 , 1,2,4,0,0,0,\cdots . Values of 3 a ( m o d 8 ) 3^a\pmod{8} are 1 , 3 , 1 , 3 , 1 , 3 , 1,3,1,3,1,3,\cdots . However, since we know that a 1 ( m o d 2 ) a\equiv 1\pmod{2} we must have 3 a 3 ( m o d 8 ) 3^a\equiv 3\pmod{8} . Thus we now have 2 a 3 1 ( m o d 8 ) 2 a 4 ( m o d 8 ) a = 2 2^a-3\equiv 1\pmod{8}\implies 2^a\equiv 4\pmod{8}\implies a=2 . However, a = 2 a=2 won't work because we have a 1 ( m o d 2 ) a\equiv 1\pmod{2} . Thus this case also has no solutions. \square

Since we have exhausted both cases, we are done (whew!) Q . E . D . \mathbb{Q}.\mathbb{E}.\mathbb{D}.

For the second case, you can simplify it by observing that 2 b 41 b 6 2^b \geq 41 \Rightarrow b \geq 6 . Taking ( m o d 8 ) \pmod{8} , we get that 3 a 1 ( m o d 8 ) - 3^a \equiv 1 \pmod{8} which has no solution.

Calvin Lin Staff - 7 years ago

Log in to reply

@Calvin Lin : Emm I dont understand. Why isn't 2 2 an answer. 3 a 1 ( m o d 2 ) 3^{a} \equiv 1 \pmod{2} and 2 b 0 ( m o d 2 ) 2^{b} \equiv 0 \pmod{2} so 3 a 2 b 1 ( m o d 2 ) 3^{a} - 2^{b} \equiv 1 \pmod{2} which says 2 can never be of the form 3 a 2 b 3^{a} - 2^{b} . Anything wrong with my answer??

chandrasekhar S - 6 years ago

Log in to reply

3 1 2 0 3^1 - 2 ^ 0

So, the place where you made an error is in saying that 2 b 0 ( m o d 2 ) 2^b \equiv 0 \pmod{2} .

Calvin Lin Staff - 6 years ago

I think this solution is legit. Nice job @Nathan Ramesh

Daniel Liu - 7 years ago

@Finn Hulse - Your proof??

Ashu Dablo - 6 years, 9 months ago

Superb!! How do you find out when and what mod to take?? Also, did you do it for all the primes before 41 also?? @Nathan Ramesh

Satvik Golechha - 7 years ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...