cp's OEIS Frontend

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.

A362564 a(n) is the largest integer x such that n + 2^x is a square, or -1 if no such number exists.

This page as a plain text file.
%I A362564 #44 Jul 28 2023 23:51:42
%S A362564 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,
%T A362564 -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,
%U A362564 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
%N A362564 a(n) is the largest integer x such that n + 2^x is a square, or -1 if no such number exists.
%C A362564 a(n) is the maximum integer solution x of the indefinite equation n + 2^x = r^2 where n is a constant and r is a positive integer, or -1 if there are no solutions.
%C A362564 See A247763 for the number of solutions and for further information, references and links about this problem.
%C A362564 If n == 0 (mod 4), we first try x = 0 or 1; when x >= 2, the result can be derived from the result for n/4 (see formula).
%C A362564 If n == 2 (mod 4), the only possible values of x is 1, as otherwise n + 2^x == 2 (mod 4), so nonsquare.
%C A362564 If n == 3 (mod 4), the only possible values of x are 0 and 1, as otherwise n + 2^x == 3 (mod 4), so nonsquare.
%C A362564 If n == 1 (mod 4), or n = 4*k + 1 (k >= 0): we suggest that r = 2*m + 1, 4*k + 1 + 2^x = (2*m + 1)^2, thus k + 2^(x - 2) = m*(m + 1); if k is odd, the only possible values of x is 2 because m*(m + 1) is even.
%C A362564 If n = k^2 (k >= 1), 2^x = (r + k)*(r - k), so 2k must be in the form 2^i - 2^j.
%C A362564 The problem can be solved via reduction to three Mordell curves: n + z^3 = y^2, n + 2z^3 = y^2 or equivalently 4n + (2z)^3 = (2y)^2, n + 4z^3 = y^2 or equivalently 16n + (4z)^3 = (4y)^2, where z := 2^floor(x/3). For a given n, each of these three curves is known to have only a finite number of integer points (y,z), proving that x cannot be unbounded. - _Max Alekseyev_, Apr 26 2023
%H A362564 Thomas Scheuerle, <a href="/A362564/b362564.txt">Table of n, a(n) for n = 1..1000</a>
%F A362564 a(4*k + 2) = 1 if k + 1 is a square, or -1 otherwise.
%F A362564 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.
%F A362564 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.
%F A362564 a(8*k + 5) = 2 if 8*k + 9 is a square, or -1 otherwise.
%F A362564 a((2^i - 2^j)^2) = i + j + 2 for i,j >= 0.
%F A362564 a(n) > -1 if A247763(n) > 0, or equivalently n is in A051204. - _Thomas Scheuerle_, May 02 2023
%e A362564 See COMMENTS section for further proof.
%e A362564 For n = 1, 1 + 2^3 = 9 = 3^2;
%e A362564 for n = 4, 4 + 2^5 = 36 = 6^2;
%e A362564 for n = 7, 7 + 2^1 = 9 = 3^2;
%e A362564 for n = 9, 9 + 2^4 = 25 = 5^2.
%o A362564 (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<<k and z==1<<(v:=valuation(z,2))), default=-1) # _Max Alekseyev_, Apr 26 2023
%Y A362564 Cf. A000079, A000290, A051204, A234000, A238454, A247763.
%K A362564 sign
%O A362564 1,1
%A A362564 _Yifan Xie_, Apr 24 2023