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

Working on isometric paths in hypercubes, I came up with the following simple, yet (imo) interesting problem. For what natural numbers $n$ exists a natural number $t$ such that $n^2+n+2=2^t$? The first few terms are $n=0,1,2,5,90$, and these are all below one million. Does someone have any idea how to approach this problem? I basically only want to know whether there exist infinitely many $n$ or not (maybe even that 0, 1, 2, 5, and 90 are the only possible ones).



share|cite|improve this question
Beyond ($n=1,t=2$), $t$ will always be odd, because $n^2 < n^2+n+2 < (n+1)^2$. – Colonel Panic Aug 22 '12 at 15:05
It is easily equivalent to a beautiful relation $$ \sum_{i=1}^{n} i = \sum\limits_{j=1}^{t-1}2^j $$ – Ilya Aug 22 '12 at 15:07
up vote 25 down vote accepted

That there are no more positive solutions was proved by Nagell, settling a conjecture of Ramanujan. The problem is discussed in this paper, and in this Wikipedia article.

To see that these solve the problem, a small preliminary transformation of your equation is useful. Rewrite it as $4n^2+4n+8=2^k$, and then as $(2n+1)^2+7=2^k$. We have arrived at the Ramanujan-Nagell equation.

share|cite|improve this answer
Thanks! Reading the Wikipedia article, I just realized I forgot the simplest of all solutions: $n=0$. – Sacha Aug 23 '12 at 7:07
@Sacha: And there area few negatives, which presumably you are not interested in. That's why in the answer I wrote there are no more positive. – André Nicolas Aug 23 '12 at 7:10
Ah yep, thanks. I just rephrased the question accordingly. – Sacha Aug 23 '12 at 7:17
@AndréNicolas : So basically there are only few solutions as in wikipedia article given right ? – Theorem Aug 23 '12 at 7:20

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.