Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

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

When is the sum $1+2+\cdots + n = (n+1) + (n+2) + \cdots +(n+k)$?

The easiest solution $(n,k)$ is $(2,1)$. For example, $1+2 = 3$. Do any others exist?

Roots of $(n+k)^2 + (n+k) = 2n^2 +2n$ give solutions (Is this solvable via a Pell equation?)

If a complete graph has red($n$) and blue($k$) nodes, and I pick an edge at random; the probability of picking one that connects two red vertices is $1/2$, find the number of blue and red nodes.

This may be trivial but I really have no clue so I ask the pros.

A (sort of) variation on the first problem of "Fifty Challenging problems in probability with solutions" Frederick Mosteller.

share|cite|improve this question
See slides 17--21 of the talk, which also discusses sums of consecutive integers with a gap (the second sum starting at $n+2$, for instance). – KCd May 11 '12 at 3:06
up vote 13 down vote accepted

Write the equation $(n+k)^2+n+k = 2 (n^2 + n)$ as $(2n+2k+1)^2 - 2 (2n+1)^2 = -1$. Solutions to the Pell equation $x^2 - 2 y^2 = -1$ all have $x$ and $y$ both odd, so every such solution with $x$, $y$ positive gives a solution of your problem by $n=(y-1)/2$, $k=(x-y)/2$. The first few $(n,k)$ pairs are
$$ \left[ \begin {array}{cc} 0&0\\ 2&1 \\ 14&6\\ 84&35 \\ 492&204\\ 2870&1189 \\ 16730&6930\\ 97512&40391 \\ 568344&235416\\ 3312554&1372105 \\ 19306982&7997214\end {array} \right] $$

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.