Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Let $1 = d_1 < d_2 <\cdots< d_k = N$ be all the divisors of $N$ arranged in increasing order. Given that $N=d_1^2+d_2^2+d_3^2+d_4^2$, determine $N$. The divisors include $N$. It seems that $130$ is an answer. Is there another possible answer for $N$?

share|cite|improve this question
Is N considered to be a divisor of N? – daniel Nov 16 '12 at 13:45
@sperners lemma: The sum if just for the first 4 divisors, it does not necessarily include $N^2$ – alejopelaez Nov 16 '12 at 13:55
The sum of the squares of the first 4 divisors only. – John Chang Nov 16 '12 at 13:56
OEIS lists a few more numbers that are the sum of the squares of the first few divisors. – Ross Millikan Nov 16 '12 at 14:21
The above question is posted as a Challenge problem on, which offers weekly problem sets to test student's problem solving abilities. John Chang has been posting questions on and expecting others to solve the problems for him. He has posted another one of our questions at… - Calvin Lin Mathematics Challenge Master – Calvin Lin Dec 29 '12 at 1:08
up vote 3 down vote accepted

The equation $$N = 1 + d_1^2 + d_2^2 + d_3^2$$ implies $N$ even by reducing $\mod 2$. Suppose $2^2|N$ then there are three possible cases:

  • $N = 1 + 2^2 + 4^2 + 8^2$ - but this is impossible by arithmetic.
  • $N = 1 + 2^2 + 4^2 + p^2$ (with $p>3$) - but reducing $\mod p$ we find $0 \equiv 13 \pmod p$ so $p = 13$ but this too is impossible by arithmetic.
  • $N = 1 + 2^2 + 3^2 + 4^2$ - impossible by arithmetic.

So $2$ is the highest power of $2$ dividing $N$, thus we have the cases:

  • $N = 1 + 2^2 + p^2 + q^2$ (with $q < 2p$) but this is impossible by reducing $\mod 2$
  • $N = 1 + 2^2 + p^2 + (2p)^2$ so $N = 5(1+p^2)$ and $5|N$ so $p$ must be $3$ (impossible by arithmetic) or $5$.

This shows the only possible solution is $130$.

share|cite|improve this answer

$N$ is even (if not then all $d_i$ are odd, making $\sum_{i=1}^4 d_i^2$ even). Therefore $d_1=1$ and $d_2=2$, and at exactly one of $d_3$ and $d_4$ is even.

Suppose that $4 \mid n$. Then one of $d_3, d_4$ is $4$ and the other is an odd prime $p$. Since $N=21+p^2$ and $p \mid N$, we have $p \mid 21$. But $4 \nmid 21+3^2$ and $5 \mid 21+7^2$, ruling out both choices of $p$.

Thus $4 \nmid n$. $d_3$ is an odd prime $p$ and $d_4$ is even. Since $d_4/2$ is a smaller divisor, it could only be $d_3$. Therefore $N = 1+4+p^2+4p^2 = 5(1+p^2)$. $3$ cannot divide a number of this form, and clearly $5$ does. Therefore $d_3=5$ and $d_4=10$, uniquely determining $N=130$.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.