# Whose 1930 number theory result is used in characterizing perfect 2-error correcting linear codes?

In Error-Correcting Codes: A Mathematical Introduction (Chapman & Hall, 1998), John Baylis wrote (p.109)

Moving on to 2-error correcting linear codes, the condition for perfection of linear codes of dimension $$k$$ is $$M = 2^k = \frac{2^n}{1 + n + \binom{n}{2}} = \frac{2^{n+1}}{2 + n + n^2}$$ so $$2+n+n^2$$ must be a power of 2. It was shown in 1930 that $$n = 1, 2, 5$$ and 90 are the only positive integers for which this is true.

without any citation. Any ideas whose 1930 number theory result he had in mind? Of course, a reference would be wonderful.

This came up in a MathOverflow question about when $$\sum_{k=0}^n \binom{N}{n}$$ is a power of 2.

Edit: As markvs explains in his answer (and as discussed in my answer to the MO question), this is equivalent to what is now known as the Ramanujan--Nagell equation $$2^n + 7 = x^2$$. This only deepens the question of what Baylis was referring to:

• Is there a 1930 result that addresses $$2^n + 7 = x^2$$, predating Nagell's 1948 solution (and Ljunggren's 1943 posing of the problem, both presumably unaware of Ramanujan's 1913 question)?

• Was there a 1930 result about when $$n^2 + n + 2$$ is a power of 2 with no connection made to Ramanujan's question?

• Who is the first (so far) known person to state and prove that $n^2 + n + 2$ or the sum of the first three numbers in a row of Pascal's triangle (as Golay put it in 1949) can be a power of two iff $n=1,2,5,90$? Nagell does not seem to do it. Was it Cohen 1964? Jan 9 at 5:24
• @Conifold There are two possibilities the Cohen mentions. (1) Shapiro & Slotnick come very close (On the mathematical theory of error correcting codes, IBM Journal, 1959): they invoke an additional condition from coding theory for one case of their Theorem 5 since "the calculation is reduced somewhat," but they claim it could be done without it. (continued in next comment) Jan 9 at 16:56
• @Conifold (2) Browkin & Schinzel (Sur les nombres de Mersenne qui sont triangulaires, C. R. Acad. Sci. Paris, 1956) find all solutions to $2^x - 1 = y(y+1)/2$, which is closer than the form of Ramanujan's question. By the way, based on the title of a 1960 work of the same two authors, On the equation $2^n−D=y^2$ (Bull. Acad. Polon. Sci. Sér. Sci. Math. Astronom. Phys.), they probably made the connection to the Ramanujan-Nagell equation, although I have not been able to access this latter article to verify their references. Jan 9 at 17:13
• At least, the MR reviewer (S. Chowla) of their 1960 paper did make the connection in MR0130215, according to MathSciNet. Jan 10 at 6:47

• The solution of R. conjecture was in 1948. The fact that it implies your statement was noticed in the 21st century ($\sim$ 2012). I am not sure adding an answer to a question is appropriate, but do as you wish. Jan 8 at 15:43
• The connection between Nagell's solution and the statement about binomial sums was made by 1964 at the latest: Edward Cohen, A note on perfect double error-correcting codes on $q$ symbols, Information and Control 7 (1964) 381-384. Jan 8 at 16:23