OFFSET
1,7
COMMENTS
Equivalently, number of representations of n as n = 2^m - x^2, m > 0, x > 0.
If n odd <> 7, R. Apéry proved in 1960 that the equation x^2 + n = 2^m has at most 2 solutions (see link).
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).
LINKS
R. Apéry, Sur une équation Diophantienne, C. R. Acad. Sci. Paris Sér. A251 (1960), 1263-1264.
Frits Beukers, On the generalized Ramanujan-Nagell equation, I, Acta arithmetica, XXXVIII, 1980-1981, page 389-410.
Wikipedia, Ramanujan-Nagell equation.
EXAMPLE
1^2 + 1 = 2^1 hence a(1) = 1.
3^2 + 23 = 2^5 and 45^2 + 23 = 2^11 hence a(23) = 2.
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.
CROSSREFS
KEYWORD
nonn
AUTHOR
Bernard Schott, Aug 06 2020
EXTENSIONS
More terms from Jinyuan Wang, Aug 07 2020
STATUS
approved