0

Find all natural numbers $n$ less than $100$ such that $n^{122} - 96n^{81}$ ends in the digits $77$.

To do this problem, I first tried using Fermat's little theorem, where $n^{7-1} ≡ 1\pmod 7$, but in the real problem, I only got up to the part where $122 ≡ 3\pmod 7$, and $81 ≡ 4\pmod 7$, but subtracting these do not give anything related to the last digits ending in $77$, so I am a bit stuck. I also do not know how to incorporate the $96$ in front of the $n^{81}$ into the modulus calculation.

Any help is appreciated $:)$

Gary
  • 31,845
  • 5
    It seems like you're attempting some Chinese Remainder Theorem proof here by taking things mod 7 (and maybe mod 11 later?), but you should actually be taking things mod 100, since you're looking for the last two digits of the number. 100 isn't prime, so you have to upgrade Fermat a little bit, do you know of such an upgrade? – Eric Nathan Stucky Sep 18 '23 at 06:58
  • 1
    Hint: $,(n,100)=1,$ so $!\bmod 100!:\ n^{20}\equiv1,$ so our equation is $,f(n)=n^2!+!4x!+!23\equiv 0$. Working $\bmod 10!:\ 0\equiv n^2+4n+3 = (n!+!1)(n!+!3)!\iff! n\equiv \color{#0a0}{-1},\color{darkorange}{-3},$ (prove!). $ $ Case $\color{#0a0}1!:\ n = \color{#0a0}{-1}!+!10x,$ so $\bmod 100!:\ 0\equiv f(n) = f(-1!+!10x)\equiv 20x+20!!!\overset{\div 20!}\iff \bmod \color{#c00}5!:\ 0\equiv x!+!1!\iff!x\equiv 4!\iff! $ $\color{#c00}{x=4!+!5k},,$ so $, n = -1!+!10\color{#c00}x = -1!+!10(\color{#c00}{4!+!5k})\equiv 39,89\pmod{!100}.\ $ – Bill Dubuque Sep 18 '23 at 08:00
  • 1
    Case $\color{darkorange}2!:\ n = \color{darkorange}{-3}!+!10x,$ works the same way. We Hensel lifted a solution $!\bmod 10,$ up to $!\bmod 10^2.\ $ Alternatively we can use CRT to combine solutions mod $4$ & $25,,$ a method shown in many prior answers, e.g. here and here. – Bill Dubuque Sep 18 '23 at 08:09
  • I'm not sure there are solutions $n<100$. By Euler, we reduce the equation to $n^2-96n \equiv 77 \bmod 100$. Thus $n^2-96n-(100k+77)=0$. Using the quadratic formula, the positive integer solution to that equation is $n=107$ (where $k=11$). Checks: $107^2-96\cdot 107=1177$. – Keith Backman Sep 18 '23 at 14:54
  • @Keith I already derived $2$ solutions above: $n = 39,89.,$ The remaining two (Case $\color{darkorange}2)$ are $7,57.\ $ Note that if $n$ is a root and $n'\equiv n\pmod{!100}$ then $n'$ is also a root, so $107$ is a root $\Rightarrow 7$ is a root. – Bill Dubuque Sep 18 '23 at 15:29
  • @Bill Dubuque I think I see my error. For $n=7,57,39,89$ the value of $n^2-96n$ is negative. But that plainly does not translate to $n^{122}-96n^{81}$ being negative. My approach is flawed. Thanks for calling this to my attention. – Keith Backman Sep 18 '23 at 21:30
  • You already have a sketch of how to solve this with links to many worked examples. What more do you seek? This is a duplicate of many prior questions. – Bill Dubuque Oct 05 '23 at 06:47
  • its the part where you prove all the steps between: i had another solution where $n^2-96n = 77+100k$, where $k$ is an integer, because of the Euler Fermat theorem, but I am not able to find a solid proof to find all k where $n<100$. I used trial and error instead. – Alan Gardiner Oct 05 '23 at 06:47
  • Steps between what? Precisely what steps are not clear? Did you read the linked posts? – Bill Dubuque Oct 05 '23 at 06:48
  • yes I have read the linked posts – Alan Gardiner Oct 05 '23 at 06:54
  • I have not learnt methods this advanced in math - can you make it simpler? – Alan Gardiner Oct 05 '23 at 06:55
  • 1
    Which method is advanced? The sketched solution uses only very simple modular arithmetic. You need to be much more specific about what you do not understand in order for us to help you. – Bill Dubuque Oct 05 '23 at 17:29

3 Answers3

2

My method involves using modular arithmetic.

Numbers end in $77$ when they have residues $1\bmod 4$ and $2\bmod25$. So we reduce the equation in bth residue classes.

$\bmod 4\implies n^{122}\equiv1\implies n\equiv1\bmod2$ (all odd squares are $\equiv1\bmod4$)

$\bmod25\implies n^{122}+4n^{81}\equiv2\implies n^2+4n-2\equiv0$ (because $20$ is the Euler totient of $25$ so $n^{20}\equiv1\bmod25$ for all non-multiples of $5$)

So to get residues of $n\bmod25$ we should solve

$n^2+4n-2\equiv0$

We can use the quadratic formula. Thus

$n\equiv(2^{-1})(-4\pm\sqrt{-1})$

We have a Pythagorean triple $7^2+24^2=25^2$ where $24\equiv-1$, so the square roots of $-1\bmod25$ must be $7$ and its additive inverse $18$. (Since $25$ has only one prime factor there are no more such roots.) Then

$2^{-1}×(-4+18)\equiv7$

$2^{-1}×(-4+7)\equiv2^{-1}×(-4+32)\equiv14$

So we look for odd numbers that are either $7$ or $14$ greater than a multiple of $25$. The numbers in range that are $7$ greater than a multiple of $25$ are $7,32,57,82$ from which we accept $7,57$; and numbers $14$ greater than a multiple of $25$ are $14,39,64,89$ from which we take $39,89$.

Thus $\{7,39,57,89\}$.

Oscar Lanzi
  • 39,403
1

Since we're interested in the last two digits (in base $10$), we're interested in the result mod $100$. We must solve $n^{122} - 96n^{81} = 77 \mod 100$ . Since $77$ is not divisible by $2$ or $5$, we may deduce that neither is $n$. Therefore, $n$ and $100$ are co-prime.

The number $100$ is not prime, so we can't apply Fermat's theorem. We can however apply its generalization, Euler's theorem.

This shows:

$$n^{\phi(100)} = 1 \mod 100$$

where $\phi$ is Euler's totient function (counting the numbers from 1 to 100 which are coprime to 100). We have $\phi(100) = 2*1*5*4 = 40$, so $n^{40} = 1 \mod 100$.

We can simplify our equation to solving:

$$n^{2} - 96n^{1} = 77 \mod 100$$

This gives $(n-48)^2 - 48^2 = 77 \mod 100$, so $(n-48)^2 = 81 \mod 100$

We group as $(n-48)^2 - 9^2 = 0 \mod 100$, so $(n-57)(n-39) = 0 \mod 100$.

The obvious solutions are $57$ and $39$, with this working if we add $50$, resulting in $7$ and $89$.


Edit: to add more detail to the factoring, we need to split the factors of $100$ between $n-57$ and $n-39$. We know that the terms are of the same parity, so either both are even, or neither are. Additionally, the difference between them is $18$, so at most one may be divisible by $5$ (therefore, $25$). Even divisors of $100$ that are multiples of $25$ are $\{50, 100\}$. We obtain the four solutions of: $(n-57)(n-39) = 0 \mod 100$ by solving for:

$n-57 = 100 \mod 100$
$n-39 = 100 \mod 100$
$n-57 = 50 \mod 100$
$n-39 = 50 \mod 100$

user3257842
  • 3,617
0

We have $n^{81}(n^{41}-96)\equiv{77}\pmod{100}$ and $n^{81}\equiv n^{41}\equiv n\pmod{10}$ because $n^{4k+1}\equiv n\pmod{10}$ so we have $n(n-6)\equiv7\pmod{10}$. The only ways to get $7$ by multiplication modulo $10$ is with the factors $1$ with $7$ and $3$ with $9$.

It follows the conditions $n\equiv 7\space \text {or }1\pmod{10}$ and $n\equiv9\space \text {or }3\pmod{10}$. However $1-6\equiv5\pmod{10}$ and $3(3-6)\equiv1\pmod{10}$ so we discard the numbers ending in $1$ and $3$ and have only to verify the natural numbers less than $100$ of the form $10x+7$ and $10x+9$ whose said powers are congruent wit $77$ modulo $100$. This involves a straightforward calculation and I suppose the answer of four numbers given by Oscar Lanzi is correct.

Piquito
  • 29,594