OFFSET
1,1
COMMENTS
D = 7 corresponds to Ramanujan-Nagell equation x^2 + 7 = 2^m with its 5 solutions (A038198 for x, A060728 for n, Wikipedia link).
If D odd <> 7, R. Apéry proved in 1960 that the equation x^2 + D = 2^m has at most 2 solutions (see links).
If D odd > 0, this equation has 2 solutions iff D = 23 or D = 2^k - 1 for some k >= 4 (link Beukers, theorem 2, p. 395).
For any solution (x,m), m is bounded by m < 435 + 10 * (log(D) / log(2)) [link Beukers, corollary 1, p. 394]. If D < 2^96, then the bound becomes m < 18 + 2 * (log(D) / log(2)) [link Beukers, corollary 2, p. 395].
REFERENCES
Richard K. Guy, Unsolved Problems in Theory of Numbers, Springer-Verlag, 2004, D10.
LINKS
R. Apéry, Sur une équation Diophantienne, C. R. Acad. Sci. Paris Sér. A251 (1960), 1263-1264.
R. Apéry, Sur une équation Diophantienne, C. R. Acad. Sci. Paris Sér. A251 (1960), 1451-1452.
Frits Beukers, On the generalized Ramanujan-Nagell equation, I, Acta arithmetica, XXXVIII, 1980-1981, page 389-410.
Wikipedia, Ramanujan-Nagell equation.
Index entries for linear recurrences with constant coefficients, signature (3,-2).
FORMULA
From Colin Barker, Aug 05 2020: (Start)
G.f.: x*(7 - 6*x - 8*x^2 - 8*x^3 + 16*x^4) / ((1 - x)*(1 - 2*x)).
a(n) = 3*a(n-1) - 2*a(n-2) for n>5.
a(n) = 2^(1+n)-1 for n>3.
(End)
The two formulas with a(n) are true, according to theorem 2 of Beukers' link. - Bernard Schott, Aug 07 2020
EXAMPLE
For these exceptional cases, the corresponding solutions are:
D = 7, (x,m) = (1,3), (3,4), (5,5), (11,7), (181,15);
D = 23, (x,m) = (3,5), (45,11);
D = 2^k -1, k >= 4, (x,m) = (1,k), (2^(k-1) - 1, 2*(k-1)).
For k = 4 and D = 15, then 1^2 + 15 = 2^4 = 16, and 7^2 + 15 = 2^6 = 64.
Remark: for k = 2 and D = 3, the two possible solutions corresponding to 2^k-1 coincide with (1, 2).
CROSSREFS
KEYWORD
nonn
AUTHOR
Bernard Schott, Aug 04 2020
STATUS
approved