What is the smallest number $n>2$ of this kind?

In defining perfect numbers we want that the sum of its divisors (including itself) is equal twice the number itself. We can define more general classes of numbers such that sum of its divisors is divisible by the number itself, i.e. we can ask is it true that for every $k \in \mathbb N (k>1)$ there exists at least one (or infinitely many) natural numbers such that the sum of their divisors is equal to $kn$.

But what happens if we sum non-divisors?

As an example let us take the number $12$. It is divisible by $1,2,3,4,6,12$ so the sum of its non-divisors is $5+7+8+9+10+11=50$ and $50$ is not a multiple of $12$.

What is the smallest number $n>2$ such that the sum of its non-divisors is a multiple of $n$?

(if you find more than one number of this kind feel free to post it in an answer)

• An odd perfect number will do. Finding one, let alone many, will make you famous :-) – Jyrki Lahtonen Apr 14 '17 at 14:46
• Why is perfectness necessary? @JyrkiLahtonen – DHMO Apr 14 '17 at 14:47
• It's not. Just a joke. – Jyrki Lahtonen Apr 14 '17 at 14:47
• Program gave me 24, 4320, and 4680. – DHMO Apr 14 '17 at 14:52
• @DHMO You can post that as an answer if you want to, it is at least a proof that such numbers exist. – Paladin Apr 14 '17 at 14:55

Let $n$'s factorization be $\prod_{i=1}^kp_i^{k_i}$. Then we get $\sigma(n)=n\prod_{i=1}^k(1+1/p_i+\cdots+1/p_i^{k_i})$. Therefore, the sum of non-divisors is$$\frac{n(n+1)}{2}-n\prod_{i=1}^k\left(1+\frac{1}{p_i}+\cdots+\frac{1}{p_i^{k_i}}\right)$$ and we are looking for $n$ which makes this number multiple of $n$. By dividing by $n$, the condition becomes$$\frac{n+1}{2}-\prod_{i=1}^k\left(1+\frac{1}{p_i}+\cdots+\frac{1}{p_i^{k_i}}\right)$$is integer.

If $n$ is odd, then the problem becomes finding odd $n$ which makes $\prod_{i=1}^k(1+1/p_i+\cdots+1/p_i^{k_i})$ integer. Such $n$ will have integral abundancy, and will be odd multiperfect number! No such number was discovered so far, and their non-existence was not proved.

If $n$ is even, there are many numbers known to have "half-integral" abundancy. You can check the list at A159907.

Number 24 Here is a small ruby script

for a in 3...100
mysum = 0
for i in 1...a
if a % i != 0
mysum += i
end
end
if mysum % a == 0
p "I found number #{a}"
break;
end
end