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-3 of 3 results.

A357754 a(n) is the largest square with n binary digits.

Original entry on oeis.org

4, 9, 25, 49, 121, 225, 484, 961, 2025, 3969, 8100, 16129, 32761, 65025, 131044, 261121, 524176, 1046529, 2096704, 4190209, 8386816, 16769025, 33547264, 67092481, 134212225, 268402689, 536848900, 1073676289, 2147395600, 4294836225, 8589767761, 17179607041, 34359441769
Offset: 3

Views

Author

Hugo Pfoertner, Oct 11 2022

Keywords

Crossrefs

Programs

  • Mathematica
    Array[Floor[Sqrt[2^# - 1]]^2 &, 33, 3] (* Michael De Vlieger, Oct 11 2022 *)
  • PARI
    for (n=3, 35, forstep (k2=2^n-1, 2^(n-1), -1, if (issquare(k2), print1(k2,", "); break)))
    
  • PARI
    a(n) = if(n%2 == 1, (sqrt(1<David A. Corneth, Oct 11 2022
    
  • Python
    from math import isqrt
    def A357754(n): return (isqrt((1<>1))-1)**2 # Chai Wah Wu, Oct 13 2022

Formula

a(n) = 2^n - A056007(n). - Kevin Ryde, Oct 13 2022
a(n) = A116601(n+2)^2. - Michel Marcus, Oct 13 2022

A056008 Difference between (smallest square strictly greater than 2^n) and 2^n.

Original entry on oeis.org

3, 2, 5, 1, 9, 4, 17, 16, 33, 17, 65, 68, 129, 89, 257, 356, 513, 697, 1025, 1337, 2049, 2449, 4097, 4001, 8193, 4417, 16385, 17668, 32769, 24329, 65537, 4633, 131073, 18532, 262145, 74128, 524289, 296512, 1048577, 1186048, 2097153, 1778369
Offset: 0

Views

Author

Henry Bottomley, Jul 24 2000

Keywords

Comments

If n is even, a(n) = 2*2^(n/2) + 1, since 2^n = (2^(n/2))^2, and a(n) = (2^(n/2) + 1)^2 - (2^(n/2))^2 = 2*2^(n/2) + 1. - Jean-Marc Rebert, Mar 02 2016
If n is odd, a(n) = 4*a(n-2) or 4*a(n-2) - 4*sqrt(a(n-2) + 2^(n-2)) + 1. - Robert Israel, Mar 02 2016

Examples

			a(5)=6^2-2^5=4; a(6)=9^2-2^6=17
		

Crossrefs

Bisections: A000051, A238454.

Programs

  • Magma
    [(Floor(2^(n/2))+1)^2-2^n : n in [0..50]]; // Vincenzo Librandi, Mar 03 2016
    
  • Maple
    f:= proc(n) local m;
       if n::even then m:= 2*2^(n/2)+1
       else m:= ceil(sqrt(2)*2^((n-1)/2))
       fi;
       m^2-2^n
    end proc:
    map(f, [$0..100]); # Robert Israel, Mar 02 2016
  • Mathematica
    ssg[n_]:=Module[{s=2^n},(1+Floor[Sqrt[s]])^2-s]; Array[ssg,50,0] (* Harvey P. Dale, Aug 22 2015 *)
    Table[((Floor[2^(n/2)] + 1)^2 - 2^n), {n, 0, 50}] (* Vincenzo Librandi, Mar 03 2016 *)
  • Python
    from math import isqrt
    def A056008(n): return (isqrt(m:=1<Chai Wah Wu, Apr 28 2023

Formula

a(n) = (floor(2^(n/2))+1)^2 - 2^n = (A017910(n)+1)^2 - A000079(n). - Vladeta Jovovic, May 01 2003
a(2k) = 2*2^k + 1 = 2*a(2(k-1)) - 1. - Jean-Marc Rebert, Mar 02 2016

A248346 Primes of the form 2^x - y^2, with y^2 < 2^x.

Original entry on oeis.org

2, 3, 7, 23, 31, 47, 71, 79, 103, 127, 151, 199, 223, 271, 367, 431, 463, 487, 503, 727, 751, 823, 967, 1087, 1303, 1319, 1423, 1439, 1559, 1607, 1759, 1823, 1879, 1951, 1999, 2039, 2143, 3343, 3527, 3623, 3967, 4447, 4943, 5167, 5503, 5591, 5791, 6199, 6343
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Oct 05 2014

Keywords

Comments

Primes in A051213.

Examples

			7 is in this sequence because 7 = 2^3 - 1^2 = 2^4 - 3^2 = 2^5 - 5^2 = 2^7 - 11^2 = 2^15 - 181^2.
1559 is in this sequence because 1559 = 2^19 - 723^2 is prime. - _Sean A. Irvine_, Apr 28 2022
		

Crossrefs

Primes in A056007 form a subset of the numbers in this sequence.

Programs

  • Mathematica
    Select[Union[Flatten[Table[2^x - y^2, {x, 16}, {y, 0, Floor[Sqrt[2^x]]}]]], PrimeQ] (* Alonso del Arte, Oct 05 2014 *)

Extensions

a(24)-a(38) from Alonso del Arte, Oct 05 2014
More terms and missing terms inserted by Sean A. Irvine, Apr 28 2022
Showing 1-3 of 3 results.