This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A336881 #16 Apr 02 2025 09:43:37 %S A336881 1,0,1,1,0,0,5,0,0,0,0,1,0,0,2,1,0,0,0,0,0,0,2,0,0,0,0,5,0,0,2,0,0,0, %T A336881 0,0,0,0,1,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,1,0,0,0,0,2,0,0,2,1,0,0,0,0, %U A336881 0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1 %N A336881 a(n) is the number of solutions (x, m) of the generalized Ramanujan-Nagell equation x^2 + n = 2^m, x > 0, m > 0, n > 0. %C A336881 Equivalently, number of representations of n as n = 2^m - x^2, m > 0, x > 0. %C A336881 a(7) = 5 corresponds to Ramanujan-Nagell equation (A038198 for x, A060728 for m, Wikipedia link). %C A336881 If n odd <> 7, Apéry proved in 1960 that the equation x^2 + n = 2^m has at most 2 solutions (see link). %C A336881 If n odd, this equation has 2 solutions iff n = 23 or n = 2^k - 1 for some k >= 4 (link Beukers, theorem 2, p. 395). %H A336881 Roger Apéry, <a href="https://gallica.bnf.fr/ark:/12148/bpt6k760v/f163.image">Sur une équation Diophantienne</a>, C. R. Acad. Sci. Paris Sér. A251 (1960), 1263-1264. %H A336881 Frits Beukers, <a href="http://matwbn.icm.edu.pl/ksiazki/aa/aa38/aa3844.pdf">On the generalized Ramanujan-Nagell equation, I</a>, Acta arithmetica, XXXVIII, 1980-1981, page 389-410. %H A336881 Wikipedia, <a href="https://en.wikipedia.org/wiki/Ramanujan%E2%80%93Nagell_equation">Ramanujan-Nagell equation</a>. %e A336881 1^2 + 1 = 2^1 hence a(1) = 1. %e A336881 3^2 + 23 = 2^5 and 45^2 + 23 = 2^11 hence a(23) = 2. %e A336881 28 = 2^5 - 2^2 = 2^6 - 6^2 = 2^7 - 10^2 = 2^9 - 22^2 = 2^17 - 362^2 hence a(28) = 5. %Y A336881 Cf. A247763, A336819. %K A336881 nonn %O A336881 1,7 %A A336881 _Bernard Schott_, Aug 06 2020 %E A336881 More terms from _Jinyuan Wang_, Aug 07 2020