Let $ n$ be a composite natural number and $ p$ a proper divisor of $ n.$ Find the binary representation of the smallest natural number $ N$ such that \[ \frac{(1 + 2^p + 2^{n-p})N - 1}{2^n}\] is an integer.
Problem
Source: IMO ShortList 1990, Problem 21 (ROM 1)
Tags: number theory, Divisibility, binary representation, minimization, IMO Shortlist
tjhance
29.08.2008 00:22
We're looking for the multiplicative inverse of $ 1+2^{p}+2^{n-p}$ mod $ 2^n$.
Case 1: $ \frac{n}{p}$ is odd.
The inverse is $ 1-2^p+2^{2p}-2^{3p}+\cdots -2^{n-2p}+2^n$ because
\begin{align*}(1+2^p+2^{n-p})(1-2^p+2^{2p}-2^{3p}+\cdots -2^{n-2p}+2^n)&\equiv (1+2^p+2^{n-p})(1-2^p+2^{2p}-2^{3p}+\cdots -2^{n-2p})\\
&\equiv (1+2^p)(1-2^p+2^{2p}-2^{3p}+\cdots -2^{n-2p}) + 2^{n-p}\\
&\equiv 1-2^{n-p}+2^{n-p}\\
&\equiv 1\mod 2^n\end{align*}
Case 2: $ \frac{n}{p}$ is even.
The inverse is $ 1-2^p+2^{2p}-2^{3p}+\cdots+2^{n-2p}-2^{n-p+1}+2^n$ because
$ (1+2^p+2^{n-p})(1-2^p+2^{2p}-2^{3p}+\cdots+2^{n-2p}-2^{n-p+1}+2^n)\\
\equiv (1+2^p+2^{n-p})(1-2^p+2^{2p}-2^{3p}+\cdots+2^{n-2p}-2^{n-p+1})\\
\equiv (1+2^p)(1-2^p+2^{2p}-2^{3p}+\cdots+2^{n-2p}-2^{n-p+1}) + 2^{n-p}\\
\equiv 1+2^{n-p} -2^{n-p+1} + 2^{n-p}\\
\equiv 1+2^{n-p+1}-2^{n-p+1}\\
\equiv 1\mod 2^n$
Now that we have found these inverses, we can use the fact that, for $ y>x$, $ 2^{y}-2^{x}=2^{x}+2^{x+1}+\cdots +2^{y-1}$ to write these inverses as the sums of powers of two directly.
Yabadabadou
07.05.2018 16:04
I can't understand why it is smallest? Who can explain?
Pathological
27.06.2019 18:25
It's the smallest because there exists a unique $N$ which is less than $2^n$, and both of tjhance's examples above are $<2^n.$ My motivation for the examples given above is the fact that $\frac{1}{1+x} = 1 - x + x^2 - x^3 + \cdots,$ for $0 < x < 1.$ If we plug in $2^p + 2^{n-p}$ for $x$ in the equation above, we can obtain the examples given above.