Consecutive Integers whose Sums of Squares of Divisors are Equal

Theorem
The only two consecutive positive integers whose sums of the squares of their divisors are equal are $6$ and $7$.

Proof
The divisors of $6$ are
 * $1, 2, 3, 6$

and so the sum of the squares of the divisors of $6$ is:
 * $1^2 + 2^2 + 3^2 + 6^2 = 1 + 4 + 9 + 36 = 50$

The divisors of $7$ are
 * $1, 7$

and so the sum of the squares of the divisors of $7$ is:
 * $1^2 + 7^2 = 1 + 49 = 50$

It remains to be shown that there are no more.

Let $n \ge 7$ be an odd number.

Then both $n - 1$ and $n + 1$ are even.

Denote $\map {\sigma_2} n$ the sum of squares of the divisors of $n$.

We will show that:
 * $\map {\sigma_2} {n + 1} > \map {\sigma_2} n$
 * $\map {\sigma_2} {n - 1} > \map {\sigma_2} n$ for $n \ge 151$

Since:

Therefore:

and for $n - 1$:
 * $\map {\sigma_2} {n - 1} - \map {\sigma_2} n = \dfrac {10 - \pi^2} 8 n^2 - \dfrac 5 2 n + \dfrac {15} 2$

By Solution to Quadratic Equation, the above is greater than zero when:
 * $n > \dfrac {\paren {5/2} + \sqrt {\paren {5/2}^2 - 4 \paren {\paren {10 - \pi^2} / 8} \paren {15/2} } } {2 \paren {\paren {10 - \pi^2} / 8} } \approx 150.3$

hence there are no solutions for $\map {\sigma_2} {n - 1} = \map {\sigma_2} n$ for $n \ge 151$.

Our estimate of $\map {\sigma_2} n$ is very rough.

If $n$ is one of the following, we can get sharper estimates:

Suppose $n = p^k$ for a prime $p \ge 3$ and $k \ge 1$.

Then:

We have:

The above is greater than $0$ when $n \ge 17$.

Suppose $n = p q$, where $p, q \ge 3$ are primes and $p \ne q$.

Then:

We have:

The above is greater than $0$ when $n \ge 25$.

Therefore we just need to check the following $n \le 149$:
 * $3, 5, 7, 9, 11, 13, 15, 21, 45, 63, 75, 99, 105, 117, 135, 147$

and thus the only pair is $\map {\sigma_2} 6 = \map {\sigma_2} 7 = 50$.

We have also inadvertently proved that $\map {\sigma_2} {2 n} > \map {\sigma_2} {2 n + 1}$ for $n \ge 8$.