Task 2. Find all positive integers $n$ for which there exists a positive integer $k$ such that for every positive divisor $d$ of $n$, $d-k$ is also a (not necessarily positive) divisor of $n$.
Solution I. If $n=1$ or $n$ is a prime number, then the only positive divisors of $n$ are 1 and $n$ (which coincide in the case $n=1$). Now take $k=n+1$, then $1-(n+1)=-n$ and $n-(n+1)=-1$ must also be divisors of $n$. This is exactly correct. So $n=1$ and $n$ being prime satisfy with $k=n+1$. If $n=4$, the positive divisors are 1, 2, and 4. We choose $k=3$, so $-2, -1$, and 1 must be divisors of 4, and this is correct. So $n=4$ satisfies with $k=3$. If $n=6$, then the positive divisors are $1, 2, 3$, and 6. We choose $k=4$, so $-3, -2, -1$, and 2 must also be divisors of 6, and this is correct. So $n=6$ satisfies with $k=4$. In total, we now know that $n \leq 6$ and all prime numbers $n$ satisfy.

Now assume that $n>6$ and $n$ is not prime. Assume $n$ satisfies. Since $n$ is a positive divisor of $n$, $n-k$ is also a divisor of $n$. The largest divisor less than $n$ is at most $\frac{1}{2} n$, so $n-k \leq \frac{1}{2} n$, thus $k \geq \frac{1}{2} n$. Furthermore, 1 is a positive divisor of $n$, so $1-k$ is a divisor of $n$. We now know $1-k \leq 1-\frac{1}{2} n$. Since $n>6$, $\frac{1}{6} n>1$, so $\frac{1}{2} n-\frac{1}{3} n>1$, thus $-\frac{1}{3} n>1-\frac{1}{2} n$. The only divisors that are at most $1-\frac{1}{2} n$ are therefore $-n$ and (if $n$ is even) $-\frac{1}{2} n$. We conclude that $1-k=-n$ or $1-k=-\frac{1}{2} n$.

In the latter case, $k=\frac{1}{2} n+1$, so $n-k=\frac{1}{2} n-1$. However, analogously to the above, there is no divisor equal to $\frac{1}{2} n-1$ for $n>6$ (since after $\frac{1}{2} n$ the next possible divisor is $\frac{1}{3} n$ and that is already smaller than $\frac{1}{2} n-1$). Contradiction, because $n-k$ must be a divisor of $n$.

We are left with the case $1-k=-n$. So $k=n+1$. Since $n$ is not prime, there is a divisor $d$ with $16$ and $n$ not prime do not satisfy, so the only solutions are all $n$ with $n \leq 6$ and all $n$ that are prime.