A362564 a(n) is the largest integer x such that n + 2^x is a square, or -1 if no such number exists.
3, 1, 0, 5, 2, -1, 1, 3, 4, -1, -1, 2, -1, 1, 0, 7, 9, -1, -1, 4, 2, -1, 1, 0, -1, -1, -1, 3, -1, -1, -1, 5, 8, 1, 0, 6, -1, -1, -1, -1, 7, -1, -1, -1, 2, -1, 1, 4, 5, -1, -1, -1, -1, -1, -1, 3, 6, -1, -1, 2, -1, 1, 0, 9, 10, -1, -1, 11, -1, -1, -1, -1, 3, -1, -1, -1, 2, -1, 1, 6, -1, -1, -1, 4, -1
Offset: 1
Keywords
Examples
See COMMENTS section for further proof. For n = 1, 1 + 2^3 = 9 = 3^2; for n = 4, 4 + 2^5 = 36 = 6^2; for n = 7, 7 + 2^1 = 9 = 3^2; for n = 9, 9 + 2^4 = 25 = 5^2.
Links
- Thomas Scheuerle, Table of n, a(n) for n = 1..1000
Programs
-
Sage
def a362564(n): return max((3*v-2*k for k in range(3) for z,, in EllipticCurve([0,4^k*n]).integral_points() if z>=1<
Max Alekseyev, Apr 26 2023
Formula
a(4*k + 2) = 1 if k + 1 is a square, or -1 otherwise.
a(4*k + 3) = 1 if 4*k + 5 is a square, or 0 is k + 1 is a square and 4*k + 5 is a nonsquare, or -1 otherwise.
a(4*k + 4) = a(k) + 2 if a(k) >= 0, or 0 if 4*k + 1 is a square and a(k) = -1, or -1 otherwise.
a(8*k + 5) = 2 if 8*k + 9 is a square, or -1 otherwise.
a((2^i - 2^j)^2) = i + j + 2 for i,j >= 0.
Comments