Find all positive integers $n$ such that $\sigma(n) = n + 1 + \sigma(n+1)$ Find all positive integers $$ such that
$\sigma\left(n\right) = n + 1 + \sigma\left(n + 1\right)$, where $\sigma\,()$ is the divisor function.
I found $n = 18,\ 3200$.
For $n \leq 10^8$, only the above two integers satisfy the condition.
If no other such integers exist, can you show this?
 A: You should be able to check a much larger range quite quickly. You can get a reasonably good approximation by finding the prime factors say up to 29, which lets you exclude most cases quite quickly.
Let d(n) = sigma(n) / n. To find d(n) we find the prime factors. Then if p is a factor we multiply (1+1/p), if p^2 is a factor then we multiply (1 + 1/p + 1/p^2) etc.
Say n has factors 3^2 and 23, and no other prime factors < 30. There may be more prime factors 31, 37, 41 etc. Then d(n) > (1 + 1/3 + 1/9) (1+ 1/23), and d(n) < (1 + 3 +1/9)(1 + 1/23 ..) x (1+1/31)(1+ 1/37)…. On the right hand side a factor 1 is added. The two results will very often be far apart.
I’d print out pairs with a relative difference less than 1/1000 for example to get an impression how close they get. It’s unlikely that there is a reason if you find no nearby values, just chances against you.
A: There is a good reason why such integers will be rare.
The sum of the divisors of n is odd iff n is a power of two multiplied by an odd square. The difference of the sum of divisors of two integers is even if after dividing by the largest possible power of two both are squares or neither is a square, and the difference is odd if one is a square and the other isn’t. n is a square roughly eith probability 1/2sqrt(n), the difference between the number of divisors is even with a probability close to 1, and odd with probability close to 1/sqrt(n).
What are the chances that this difference has the same parity as n+1? If n+1 is even, about 1. If n+1 is odd, about 1/sqrt(n). That’s the probability for the difference having the same parity as n+1, the probability for being equal to n is of course much smaller.
If n+1 is even then the parity is the usually the same. But in this case, n+1 has divisors n+1 and (n+1)/2, which makes it about n/2 larger before we look at other divisors. And we added n+1, so the divisors of n ignoring the missing n/2 must be about 1.5n larger. That doesn’t happen often.
Actually, the difference which should be zero is less than a million four times for 120million < n < 130 million, and that number seems to be shrinking. If we subtract instead of adding n+1 then there are 5 solutions with n = 1, 5, 8585, 16,119, 29,886,159. They get more rare seemingly on a logarithmic scale.
I’d expect a third solution for the original problem to involve huge numbers that will never be found. The number of cases where the difference between left and right side is even and less than a million goes down rapidly. Like 30 or 40 between k and 2k when k is around a billion.
PS. If p and 6p+1 are both primes, then the divisor sum of 6p is 1+2+3+6+n+n/2+n/3+n/6 = 2n+12, while the right hand side is (n+1)+(1+(n+1)) = n+3, so we have a difference of 9 quite often.
