For any integer $n \ge2$, we define $ A_n$ to be the number of positive integers $ m$ with the following property: the distance from $n$ to the nearest multiple of $m$ is equal to the distance from $n^3$ to the nearest multiple of $ m$. Find all integers $n \ge 2 $ for which $ A_n$ is odd. (Note: The distance between two integers $ a$ and $b$ is defined as $|a -b|$.)
Problem
Source: Baltic Way 2015
Tags: number theory
09.11.2015 16:09
.
10.11.2015 00:55
I don´t think your solution is completely correct. What I think: First we can prove as in your solution that $A_n$ is just the number of integers $m$ that divide $n^3-n$ or $n^3+n$, but this doesn´t equal the number of divisors of $n(n^2-1)(n^2+1)$, as you said. In fact, by inclusion-exclusion principle $A_n$ equals $\sigma(n^3+n)+\sigma(n^3-n)-\sigma(\textnormal{gcd}(n^3+n,n^3-n))$, because the last number is the number of positive integers that divide both $n^3-n$ and $n^3+n$. Now it is easy to see that neither $n^3+n$ nor $n^3-n$ is a square for $n \geq 2$, so they both have an even number of divisors and consequently $A_n \equiv \sigma(\underbrace{\textnormal{gcd}(n^3+n,n^3-n)}_{d}) \pmod{2}$. This means that $d$ has to be a square. Since $\textnormal{gcd}(n, n^2-1) = \textnormal{gcd}(n, n^2+1)=1$, we get $d=n \cdot \textnormal{gcd}(n^2-1, n^2+1)$. Now if $n$ is even, this implies $d=n$ and hence $\sigma(d)$ is odd if and only if $n$ is a perfect square. If $n$ is odd, then $d=2n$ has to be a perfect square, which is impossible since it is divisble by $2$, but not by $4$. To sum up, $A_n$ is odd if and only if $n$ is an even perfect sqare.
13.11.2020 12:19
Problem is equivalent to find all integers $n$ such that number of distinct positive integers $m$ satisfying $n^3 \equiv n \pmod m $ or $n^3 \equiv - n \pmod m $ is an odd integer. Let $d(k)$ denotes number of positive divisor of an integer $k$. If $n$ is even, then $\gcd(n^2+1, n^2 -1) =1$ and note that $\gcd(n, n^2-1) = 1$ and $\gcd(n, n^2+1) =1 $. Thus we want quantity: $$ d(n(n^2+1)) +d(n(n^2 -1)) - d(n) = d(n)d(n^2+1) +d(n) d(n^2-1) - d(n) =d(n)(d(n^2+1) +d(n^2-1) -1) $$to be an odd integer. This forces to have that $d(n)$ is odd integer and consequently $n$ is perfect square. Since there are no consecutive integers which both are perfect squares, we conclude that $d(n^2 +1)+d(n^2 -1) - 1)$ is an odd integer and we are done. If $n$ is odd, then $\gcd(n^2+1, n^2-1) =2 $ and note that $\gcd(n, n^2-1) = 1$ and $\gcd(n, n^2+1) =1 $. Thus we want quantity: $$ d(n(n^2+1)) +d(n(n^2 -1)) -2d(n) = d(n)d(n^2+1) +d(n) d(n^2-1) - 2d(n) =d(n)(d(n^2+1) +d(n^2-1) -2) $$to be an odd integer. This forces to have that $d(n)$ is odd integer and consequently $n$ is perfect square. Since there are no consecutive integers which both are perfect square, we conclude that $d(n^2+1) +d(n^2-1) -2$ is an even integer, which is impossible. We conclude that $n = (2k)^2$ for some positive integer $k$.
14.08.2021 00:39
Define $\tau(x)$ as the number of positive divisors of $x$. We have $\vert n-mq_1\vert =d=\vert n^3-mq_2\vert$. This is equivalent to $mq=n^3\pm n$. We do need to find number of $m$'s such that $m\mid n^3-n$ and $m\mid n^3+n$ as for any $m$, there is $q\in \mathbb Z$ and choosing suitable $q_1$, implies suitable $q_2$ due to equality. We have $$A_n=\tau( n^3+n)+\tau( n^3-n)-\tau(n\gcd(n^2+1,n^2-1)).$$Note that $\tau(x)$ for any integer $x$ is odd, iff $x$ is a perfect square. Claim. $n^3+n$ and $n^3-n$ are never perfect squares. Proof. We have a equation $$n^3+n=x^2\Longleftrightarrow n(n^2+1)=x^2,$$thus $n=a^2$ and $n^2+1=b^2$ as $n\perp n^2+1$. Hence, $(b-n)(b+n)=1$, which implies that $n=0$, no solutions here. We now consider equation $$n^3-n=x^2\Longleftrightarrow n(n^2-1)=x^2,$$thus $n=a^2$ and $n^2-1=b^2$ as $n\perp n^2-1$. Hence, $(n-b)(n+b)=1$, which implies that $b=0$ and $n=1$, no solutions here. If $n$ is odd, then $$A_n=\tau( n^3+n)+\tau( n^3-n)-\tau(2n).$$As $n$ is odd, $2n$ is never a perfect square. hence, $A_n$ is even for any odd $n$. If $n$ is even, then $$A_n=\tau( n^3+n)+\tau( n^3-n)-\tau(n).$$If $n$ is not a perfect square, then $A_n$ is even. If $n$ is a perfect square, then $A_n$ is odd. Our answer is $\boxed{n=(2k)^2}$.