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

A357750 a(n) is the least k such that B(k^2) - B(k) = n, where B(m) is the binary weight A000120(m).

Original entry on oeis.org

0, 5, 11, 21, 45, 75, 217, 331, 181, 789, 1241, 2505, 5701, 5221, 11309, 19637, 43151, 69451, 82709, 166027, 346389, 607307, 689685, 1458357, 1380917, 2507541, 5906699, 2965685, 5931189, 11862197, 47448787, 82188309, 57804981, 94905541, 188883211, 373457573, 640164021
Offset: 0

Views

Author

Keywords

Examples

			  ----------------------------------------------------
  n     k      k^2     binary k             binary k^2
  ----------------------------------------------------
  0     0        0            0                      0
  1     5       25          101                  11001
  2    11      121         1011                1111001
  3    21      441        10101              110111001
  4    45     2025       101101            11111101001
  5    75     5625      1001011          1010111111001
  6   217    47089     11011001       1011011111110001
  7   331   109561    101001011      11010101111111001
  8   181    32761     10110101        111111111111001
  9   789   622521   1100010101   10010111111110111001
		

Crossrefs

Programs

  • PARI
    a(n) = my(k=0); while(hammingweight(k^2) - hammingweight(k) != n, k++); k;
    
  • Python
    from itertools import count
    def A357750(n):
        for k in count(0):
            if (k**2).bit_count()-k.bit_count()==n:
                return k # Chai Wah Wu, Oct 17 2022

A260986 Numbers n such that H(n)/H(n^2) is a new record, where H(n) = A000120(n) is the sum of the binary digits of n.

Original entry on oeis.org

1, 23, 111, 479, 1471, 6015, 24319, 28415, 490495, 6025215, 8122367, 98549759, 132104191, 1593769983, 1862205439, 29930291199, 479961546751, 514321285119, 8237743079423, 131872659079167, 136270705590271, 35461448750596095, 7998111458938322943, 9151032963545169919
Offset: 1

Views

Author

Keywords

Comments

This sequence is infinite, a result which follows from Stolarsky's Theorem 2.
a(22) > 2.4*10^13. - Giovanni Resta, Aug 07 2015
a(25) > 5.8*10^20. - Karl-Heinz Hofmann, Oct 14 2022

Examples

			23 is 10111 in binary and 23^2 = 529 is 1000010001 in binary. Each smaller number has H(n)/H(n^2) <= 1, but H(23)/H(529) = 4/3 > 1, so 23 is in this sequence.
		

Crossrefs

Subsequence of A356877.

Programs

  • Mathematica
    DeleteDuplicates[Table[{n,Total[IntegerDigits[n,2]]/Total[IntegerDigits[n^2,2]]},{n,500000}],GreaterEqual[ #1[[2]],#2[[2]]]&][[;;,1]] (* The program generates the first 9 terms of the sequence. *) (* Harvey P. Dale, Sep 21 2023 *)
  • PARI
    r=2; forstep(n=1,1e9,2, t=hammingweight(n^2)/hammingweight(n); if(t
    				

Extensions

a(16)-a(21) from Giovanni Resta, Aug 07 2015
a(22)-a(24) from Karl-Heinz Hofmann, Oct 14 2022
Showing 1-2 of 2 results.