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

A357658 a(n) is the maximum Hamming weight of squares k^2 in the range 2^n <= k^2 < 2^(n+1).

Original entry on oeis.org

1, 2, 3, 3, 5, 4, 6, 6, 8, 8, 9, 9, 13, 11, 13, 12, 14, 15, 16, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 25, 26, 27, 28, 29, 30, 31, 31, 34, 33, 34, 37, 37, 38, 38, 39, 39, 41, 41, 42, 44, 44, 44, 46, 47, 47, 49, 50, 51, 52, 52, 53, 54, 55, 55, 57, 57, 58, 59, 62, 63
Offset: 2

Views

Author

Hugo Pfoertner, Oct 09 2022

Keywords

Comments

The sequence can be approximated by a linear function c*n + d, with c ~= 0.883 +- 0.003, d ~= -1.65 +- 0.16. See linked plot. For a square number with 100 binary digits (n=99) a maximum Hamming weight of 85 or 86 is expected. For example, 1125891114428899^2 has Hamming weight 85.

Examples

			  n         A357753(n) a(n) A357659(n)    A357660(n)    A357754(n)
  bits  2^n  least sq  Ha w  k_min  ^2     k_max  ^2   largest sq
   2     4      4       1     2      4      2      4        4
   3     8      9       2     3      9      3      9        9
   4    16     16       3     5     25      5     25       25
   5    32     36       3     7     49      7     49       49
   6    64     64       5    11    121     11    121      121
   7   128    144       4    13    169     15    225      225
  12  4096   4096       9    75   5625     89   7921     8100
		

Crossrefs

A357659 and A357660 are the minimal and the maximal values of k producing a(n).

A357753 a(n) is the least square with n binary digits.

Original entry on oeis.org

4, 9, 16, 36, 64, 144, 256, 529, 1024, 2116, 4096, 8281, 16384, 33124, 65536, 131769, 262144, 525625, 1048576, 2099601, 4194304, 8392609, 16777216, 33558849, 67108864, 134235396, 268435456, 536895241, 1073741824, 2147488281, 4294967296, 8589953124, 17179869184
Offset: 3

Views

Author

Hugo Pfoertner, Oct 11 2022

Keywords

Crossrefs

Programs

  • Maple
    a:= n-> ceil(sqrt(2)^(n-1))^2:
    seq(a(n), n=3..35);  # Alois P. Heinz, Oct 13 2022
  • Mathematica
    Array[Ceiling[Sqrt[2^(# - 1)]]^2 &, 33, 3]
  • PARI
    for (n=3, 35, for(k=0, oo, if(#digits(k^2,2)==n, print1(k^2,", "); break)))
    
  • PARI
    a(n) = if(n%2 == 1, 1 << (n-1), ceil(sqrt(1<<(n-1)))^2) \\ David A. Corneth, Oct 11 2022
    
  • Python
    from math import isqrt
    def A357753(n): return 1<Chai Wah Wu, Oct 13 2022

Formula

a(n) = A017912(n-1)^2.
a(2n+1) = (2^n)^2 = 4^n, for n>=1; indeed: 4^n_{10} = 10^(2n){2} that is the least number with 2n+1 binary digits. - _Bernard Schott, Oct 15 2022

A056007 Difference between 2^n and largest square strictly less than 2^n.

Original entry on oeis.org

1, 1, 3, 4, 7, 7, 15, 7, 31, 28, 63, 23, 127, 92, 255, 7, 511, 28, 1023, 112, 2047, 448, 4095, 1792, 8191, 7168, 16383, 5503, 32767, 22012, 65535, 88048, 131071, 166831, 262143, 296599, 524287, 444943, 1048575, 296863, 2097151, 1187452, 4194303
Offset: 0

Views

Author

Henry Bottomley, Jul 24 2000

Keywords

Comments

Note that this is not a strictly ascending sequence. - Alonso del Arte, Apr 28 2022

Examples

			a(5) = 2^5 - 5^2 =  7;
a(6) = 2^6 - 7^2 = 15.
		

Crossrefs

Programs

  • Mathematica
    Table[2^n - Floor[Sqrt[2^n - Boole[EvenQ[n]]]]^2, {n, 0, 47}] (* Alonso del Arte, Apr 28 2022 *)
  • PARI
    a(n) = if(n%2, sqrtint(1<Kevin Ryde, Oct 12 2022
  • Python
    from math import isqrt
    def a(n): return 2**n - isqrt(2**n-1)**2
    print([a(n) for n in range(43)]) # Michael S. Branicky, Apr 29 2022
    

Formula

a(n) = 2^n - (ceiling(2^(n/2)) - 1)^2 = A000079(n) - (A017912(n) - 1)^2. - Vladeta Jovovic, May 01 2003
a(n) = A071797(A000079(n)). - Michel Marcus, Apr 29 2022
a(n) = 2^n - A357754(n). - Kevin Ryde, Oct 12 2022

A116601 a(0) = a(1) = 0; for n >= 2, a(n) = floor(sqrt(2^(n-2)-1)).

Original entry on oeis.org

0, 0, 0, 1, 1, 2, 3, 5, 7, 11, 15, 22, 31, 45, 63, 90, 127, 181, 255, 362, 511, 724, 1023, 1448, 2047, 2896, 4095, 5792, 8191, 11585, 16383, 23170, 32767, 46340, 65535, 92681, 131071, 185363, 262143, 370727, 524287, 741455, 1048575, 1482910, 2097151, 2965820, 4194303, 5931641
Offset: 0

Views

Author

Roger L. Bagula, Mar 28 2006

Keywords

Comments

Numbers k such that k^2 is the largest square less than the next power of 2. - Hugo Pfoertner, Sep 30 2022

Crossrefs

Programs

  • Mathematica
    Join[{0, 0}, Table[Floor[Sqrt[2^(n - 2) - 1]], {n, 2, 50}]] (* G. C. Greubel, Oct 28 2017 *)
  • Python
    from math import isqrt
    def A116601(n): return isqrt((1< 1 else 0 # Chai Wah Wu, Oct 13 2022

Extensions

Edited by N. J. A. Sloane, May 10 2007

A357657 a(n) is a lower bound for the square root of the maximum square with exactly n zeros in its binary representation.

Original entry on oeis.org

1, 0, 181, 45, 362, 1241, 2965685, 5931189, 57804981
Offset: 0

Views

Author

Keywords

Comments

See A357656 for more information.
a(9) >= 66537313397, a(10) >= 10520476455.

Crossrefs

A357656 gives the Hamming weight of the squared terms.

A357752 a(n) is the largest perfect power < 2^n.

Original entry on oeis.org

4, 9, 27, 49, 125, 243, 484, 1000, 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 12 2022

Keywords

Comments

Are all terms > 1000 identical to A357754?

Crossrefs

Programs

  • PARI
    for (n=3, 35, forstep (k=2^n-1, 0, -1, if(ispower(k), print1(k,", "); break)))
Showing 1-6 of 6 results.