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.

A372541 Least k such that the k-th squarefree number has exactly n ones in its binary expansion.

Original entry on oeis.org

1, 3, 6, 11, 20, 60, 78, 157, 314, 624, 1245, 3736, 4982, 9962, 19920, 39844, 79688, 239046, 318725, 956194, 1912371, 2549834, 5099650, 15298984, 20398664, 40797327, 81594626, 163189197, 326378284, 979135127, 1305513583, 2611027094, 5222054081, 10444108051
Offset: 0

Views

Author

Gus Wiseman, May 09 2024

Keywords

Examples

			The squarefree numbers A005117(a(n)) together with their binary expansions and binary indices begin:
       1:                   1 ~ {1}
       3:                  11 ~ {1,2}
       7:                 111 ~ {1,2,3}
      15:                1111 ~ {1,2,3,4}
      31:               11111 ~ {1,2,3,4,5}
      95:             1011111 ~ {1,2,3,4,5,7}
     127:             1111111 ~ {1,2,3,4,5,6,7}
     255:            11111111 ~ {1,2,3,4,5,6,7,8}
     511:           111111111 ~ {1,2,3,4,5,6,7,8,9}
    1023:          1111111111 ~ {1,2,3,4,5,6,7,8,9,10}
    2047:         11111111111 ~ {1,2,3,4,5,6,7,8,9,10,11}
    6143:       1011111111111 ~ {1,2,3,4,5,6,7,8,9,10,11,13}
    8191:       1111111111111 ~ {1,2,3,4,5,6,7,8,9,10,11,12,13}
   16383:      11111111111111 ~ {1,2,3,4,5,6,7,8,9,10,11,12,13,14}
   32767:     111111111111111 ~ {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}
   65535:    1111111111111111 ~ {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}
  131071:   11111111111111111 ~ {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17}
		

Crossrefs

Positions of firsts appearances in A372433.
Counting zeros instead of ones gives A372473, firsts in A372472.
For prime instead of squarefree we have A372517, firsts of A014499.
Counting bits (length) gives A372540, firsts of A372475, runs A077643.
A000120 counts ones in binary expansion (binary weight), zeros A080791.
A005117 lists squarefree numbers.
A030190 gives binary expansion, reversed A030308.
A048793 lists positions of ones in reversed binary expansion, sum A029931.
A145037, A097110 count ones minus zeros, for primes A372516, A177796.
A371571 lists positions of zeros in binary expansion, sum A359359.
A371572 lists positions of ones in binary expansion, sum A230877.
A372515 lists positions of zeros in reversed binary expansion, sum A359400.

Programs

  • Mathematica
    nn=10000;
    spnm[y_]:=Max@@NestWhile[Most,y,Union[#]!=Range[0,Max@@#]&];
    dcs=DigitCount[Select[Range[nn],SquareFreeQ],2,1];
    Table[Position[dcs,i][[1,1]],{i,spnm[dcs-1]}]
  • Python
    from math import isqrt
    from itertools import count
    from sympy import factorint, mobius
    from sympy.utilities.iterables import multiset_permutations
    def A372541(n):
        if n==0: return 1
        for l in count(n):
            m = 1<Chai Wah Wu, May 10 2024

Extensions

a(23)-a(33) from Chai Wah Wu, May 10 2024