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.

Showing 1-5 of 5 results.

A051204 Nonnegative numbers of the form x^2-2^y.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 7, 8, 9, 12, 14, 15, 16, 17, 20, 21, 23, 24, 28, 32, 33, 34, 35, 36, 41, 45, 47, 48, 49, 56, 57, 60, 62, 63, 64, 65, 68, 73, 77, 79, 80, 84, 89, 92, 96, 97, 98, 99, 105, 112, 113, 117, 119, 120, 128, 129, 132, 136, 137, 140, 142, 143, 144, 153, 161, 164
Offset: 1

Views

Author

Keywords

Examples

			5 is in the sequence because 5 can be written as 3^2-2^2
		

Crossrefs

Cf. A051213.

Programs

  • Mathematica
    max = 200; Clear[f]; f[m_] := f[m] = Select[Table[x^2 - 2^y, {y, 0, m}, {x, Floor[2^(y/2)], Ceiling[Sqrt[2^y + max]]}] // Flatten // Union, 0 <= # <= max &]; f[1]; f[m = 2]; While[f[m] != f[m/2], m = 2 m]; Print["m = ", m]; A051204 = f[m] (* Jean-François Alcover, May 13 2017 *)

Formula

{n: A247763(n) > 0 }. - R. J. Mathar, Jul 24 2022

Extensions

Corrected by Henry Bottomley, Jul 24 2000

A248344 Primes of the form x^2 - 2^y.

Original entry on oeis.org

2, 3, 5, 7, 17, 23, 41, 47, 73, 79, 89, 97, 113, 137, 167, 193, 223, 233, 257, 281, 313, 353, 359, 401, 409, 433, 439, 449, 457, 521, 577, 593, 601, 617, 727, 761, 809, 839, 857, 929, 953, 977, 1009, 1087, 1097, 1193, 1201, 1217, 1223, 1361, 1367, 1433, 1489, 1553, 1609, 1697, 1721
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Oct 05 2014

Keywords

Comments

Primes in A051204.

Examples

			17 is in this sequence because 17 = 5^2 - 2^3 = 7^2 - 2^5 = 9^2 - 2^6 = 23^2 - 2^9.
		

Crossrefs

Extensions

a(54) corrected by Charles R Greathouse IV, Nov 26 2014

A336819 Odd values of D > 0 for which the generalized Ramanujan-Nagell equation x^2 + D = 2^m has two or more solutions in the positive integers.

Original entry on oeis.org

7, 15, 23, 31, 63, 127, 255, 511, 1023, 2047, 4095, 8191, 16383, 32767, 65535, 131071, 262143, 524287, 1048575, 2097151, 4194303, 8388607, 16777215, 33554431, 67108863, 134217727, 268435455, 536870911, 1073741823, 2147483647, 4294967295, 8589934591, 17179869183, 34359738367, 68719476735
Offset: 1

Views

Author

Bernard Schott, Aug 04 2020

Keywords

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].

Examples

			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).
		

References

  • Richard K. Guy, Unsolved Problems in Theory of Numbers, Springer-Verlag, 2004, D10.

Crossrefs

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

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.

Original entry on oeis.org

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, 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, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1
Offset: 1

Views

Author

Bernard Schott, Aug 06 2020

Keywords

Comments

Equivalently, number of representations of n as n = 2^m - x^2, m > 0, x > 0.
a(7) = 5 corresponds to Ramanujan-Nagell equation (A038198 for x, A060728 for m, Wikipedia link).
If n odd <> 7, 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).

Examples

			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

Extensions

More terms from Jinyuan Wang, Aug 07 2020

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

Original entry on oeis.org

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

Views

Author

Yifan Xie, Apr 24 2023

Keywords

Comments

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.
See A247763 for the number of solutions and for further information, references and links about this problem.
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).
If n == 2 (mod 4), the only possible values of x is 1, as otherwise n + 2^x == 2 (mod 4), so nonsquare.
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.
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.
If n = k^2 (k >= 1), 2^x = (r + k)*(r - k), so 2k must be in the form 2^i - 2^j.
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

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.
		

Crossrefs

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.
a(n) > -1 if A247763(n) > 0, or equivalently n is in A051204. - Thomas Scheuerle, May 02 2023
Showing 1-5 of 5 results.