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-10 of 15 results. Next

A373198 Number of squarefree numbers from prime(n) to prime(n+1) - 1.

Original entry on oeis.org

1, 1, 2, 2, 1, 3, 1, 3, 2, 2, 4, 3, 2, 2, 2, 4, 1, 4, 3, 1, 4, 2, 4, 5, 1, 2, 3, 1, 3, 7, 3, 3, 2, 6, 1, 3, 4, 3, 2, 4, 1, 7, 1, 3, 1, 8, 9, 2, 1, 3, 4, 1, 4, 4, 4, 4, 1, 3, 2, 2, 6, 8, 3, 1, 2, 10, 3, 5, 1, 1, 5, 4, 3, 3, 3, 3, 6, 3, 5, 7, 1, 6, 1, 5, 2, 4, 5
Offset: 1

Views

Author

Gus Wiseman, May 29 2024

Keywords

Examples

			This is the sequence of row-lengths of A005117 treated as a triangle with row-sums A373197:
   2
   3
   5   6
   7  10
  11
  13  14  15
  17
  19  21  22
  23  26
  29  30
  31  33  34  35
  37  38  39
  41  42
  43  46
  47  51
  53  55  57  58
		

Crossrefs

Counting all numbers (not just squarefree) gives A001223, sum A371201.
For composite instead of squarefree we have A046933.
For squarefree numbers (A005117) between primes:
- sum is A373197
- length is A373198 (this sequence) = A061398 - 1
- min is A000040
- max is A112925, opposite A112926
For squarefree numbers between powers of two:
- sum is A373123
- length is A077643, partial sums A143658
- min is A372683, delta A373125, indices A372540, firsts of A372475
- max is A372889, delta A373126
For primes between powers of two:
- sum is A293697 (except initial terms)
- length is A036378
- min is A104080 or A014210, indices A372684 (firsts of A035100)
- max is A014234, delta A013603
Cf. A372473 (firsts of A372472), A372541 (firsts of A372433).

Programs

  • Mathematica
    Table[Length[Select[Range[Prime[n],Prime[n+1]-1],SquareFreeQ]],{n,100}]
  • Python
    from math import isqrt
    from sympy import prime, nextprime, mobius
    def A373198(n):
        p = prime(n)
        q = nextprime(p)
        r = isqrt(p-1)+1
        return sum(mobius(k)*((q-1)//k**2) for k in range(r,isqrt(q-1)+1))+sum(mobius(k)*((q-1)//k**2-(p-1)//k**2) for k in range(1,r)) # Chai Wah Wu, Jun 01 2024

Formula

a(n) = A061398(n) + 1.

A077643 Number of squarefree integers in closed interval [2^n, -1 + 2*2^n], i.e., among 2^n consecutive numbers beginning with 2^n.

Original entry on oeis.org

1, 2, 3, 5, 9, 19, 39, 79, 157, 310, 621, 1246, 2491, 4980, 9958, 19924, 39844, 79672, 159365, 318736, 637457, 1274916, 2549816, 5099651, 10199363, 20398663, 40797299, 81594571, 163189087, 326378438, 652756861, 1305513511, 2611026987, 5222053970, 10444108084
Offset: 0

Views

Author

Labos Elemer, Nov 14 2002

Keywords

Comments

Number of squarefree numbers with binary expansion of length n, or with n bits. The sum of these numbers is given by A373123. - Gus Wiseman, Jun 02 2024

Examples

			For n=4: among the 16 numbers of {16, ..., 31}, nine are squarefree [17, 19, 21, 22, 23, 26, 29, 30, 31], so a(4) = 9.
		

Crossrefs

Partial sums (except first term) are A143658.
Run-lengths of A372475.
The minimum is A372683, delta A373125, indices A372540.
The maximum is A372889 (except at n=1), delta A373126, indices A143658.
Row-sums are A373123.
A005117 lists squarefree numbers, first differences A076259.
A053797 gives nonempty lengths of exclusive gaps between squarefree numbers.
A029837 counts bits, row-lengths of A030190 and A030308.
For primes between powers of 2:
- sum A293697
- length A036378 or A162145
- min A104080 or A014210, delta A092131, indices A372684
- max A014234, delta A013603, indices A007053
For squarefree numbers between primes:
- sum A373197
- length A373198 = A061398 - 1
- min A000040
- max A112925 (delta A240473), opposite A112926 (delta A240474)
Cf. A010036, A029931, A035100, A049093-A049096, A372473 (firsts of A372472), A372541 (firsts of A372433).

Programs

  • Mathematica
    Table[Apply[Plus, Table[Abs[MoebiusMu[2^w+j]], {j, 0, 2^w-1}]], {w, 0, 15}]
    (* second program *)
    Length/@Split[IntegerLength[Select[Range[10000],SquareFreeQ],2]]//Most (* Gus Wiseman, Jun 02 2024 *)
  • PARI
    { a(n) = sum(m=1,sqrtint(2^(n+1)-1), moebius(m) * ((2^(n+1)-1)\m^2 - (2^n-1)\m^2) ) } \\ Max Alekseyev, Oct 18 2008

Formula

a(n) = Sum_{j=0..-1+2^n} abs(mu(2^n + j)).
a(n)/2^n approaches 1/zeta(2), so limiting sequence is floor(2^n/zeta(2)), n >= 0. - Wouter Meeussen, May 25 2003

Extensions

More terms from Mark Hudson (mrmarkhudson(AT)hotmail.com), Feb 12 2003
More terms from Wouter Meeussen, May 25 2003
a(25)-a(32) from Max Alekseyev, Oct 18 2008
a(33)-a(34) from Amiram Eldar, Jul 17 2024

A372433 Binary weight (number of ones in binary expansion) of the n-th squarefree number.

Original entry on oeis.org

1, 1, 2, 2, 2, 3, 2, 3, 3, 3, 4, 2, 3, 3, 3, 4, 3, 4, 4, 5, 2, 2, 3, 3, 3, 4, 3, 3, 4, 4, 5, 4, 4, 5, 4, 4, 5, 5, 5, 2, 2, 3, 3, 3, 4, 3, 3, 4, 4, 5, 3, 4, 4, 4, 5, 4, 5, 5, 5, 6, 3, 4, 4, 5, 4, 4, 5, 5, 5, 6, 4, 4, 5, 5, 6, 5, 6, 7, 2, 2, 3, 3, 3, 3, 3, 4, 4
Offset: 1

Views

Author

Gus Wiseman, May 04 2024

Keywords

Crossrefs

Restriction of A000120 to A005117.
For prime instead of squarefree we have A014499, zeros A035103.
Counting zeros instead of ones gives A372472, cf. A023416, A372473.
For binary length instead of weight we have A372475.
A003714 lists numbers with no successive binary indices.
A030190 gives binary expansion, reversed A030308.
A048793 lists positions of ones in reversed binary expansion, sum A029931.
A145037 counts ones minus zeros in binary expansion, cf. A031443, A031444, A031448, A097110.
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.
A372516 counts ones minus zeros in binary expansion of primes, cf. A177718, A177796, A372538, A372539.

Programs

  • Mathematica
    DigitCount[Select[Range[100],SquareFreeQ],2,1]
    Total[IntegerDigits[#,2]]&/@Select[Range[200],SquareFreeQ] (* Harvey P. Dale, Feb 14 2025 *)
  • Python
    from math import isqrt
    from sympy import mobius
    def A372433(n):
        def f(x): return n+x-sum(mobius(k)*(x//k**2) for k in range(1, isqrt(x)+1))
        m, k = n, f(n)
        while m != k:
            m, k = k, f(k)
        return int(m).bit_count() # Chai Wah Wu, Aug 02 2024

Formula

a(n) = A000120(A005117(n)).
a(n) + A372472(n) = A372475(n) = A070939(A005117(n)).

A373197 Sum of all squarefree numbers from prime(n) to prime(n+1) - 1.

Original entry on oeis.org

2, 3, 11, 17, 11, 42, 17, 62, 49, 59, 133, 114, 83, 89, 98, 223, 59, 254, 206, 71, 302, 161, 341, 462, 97, 203, 314, 107, 330, 824, 386, 398, 275, 856, 149, 460, 635, 494, 337, 702, 179, 1294, 191, 582, 197, 1635, 1950, 449, 227, 690, 943, 239, 983, 1013, 1036
Offset: 1

Views

Author

Gus Wiseman, May 29 2024

Keywords

Examples

			This is the sequence of row sums of A005117 treated as a triangle with row-lengths A373198:
   2
   3
   5   6
   7  10
  11
  13  14  15
  17
  19  21  22
  23  26
  29  30
  31  33  34  35
  37  38  39
  41  42
  43  46
  47  51
  53  55  57  58
		

Crossrefs

Counting all numbers (not just squarefree) gives A371201.
For the sectioning of A005117 (squarefree between prime):
- sum is A373197 (this sequence)
- length is A373198 = A061398 - 1
- min is A000040
- max is A112925, opposite A112926
For squarefree numbers between powers of two:
- sum is A373123
- length is A077643, partial sums A143658
- min is A372683, delta A373125, indices A372540, firsts of A372475
- max is A372889, delta A373126
For primes between powers of two:
- sum is A293697 (except initial terms)
- length is A036378
- min is A104080 or A014210, indices A372684 (firsts of A035100)
- max is A014234, delta A013603
Cf. A372473 (firsts of A372472), A372541 (firsts of A372433).

Programs

  • Mathematica
    Table[Total[Select[Range[Prime[n],Prime[n+1]-1],SquareFreeQ]],{n,15}]

A372683 Least squarefree number >= 2^n.

Original entry on oeis.org

1, 2, 5, 10, 17, 33, 65, 129, 257, 514, 1027, 2049, 4097, 8193, 16385, 32770, 65537, 131073, 262145, 524289, 1048577, 2097154, 4194305, 8388609, 16777217, 33554433, 67108865, 134217730, 268435457, 536870913, 1073741826, 2147483649, 4294967297, 8589934594
Offset: 0

Views

Author

Gus Wiseman, May 26 2024

Keywords

Examples

			The terms together with their binary expansions and binary indices begin:
       1:                    1 ~ {1}
       2:                   10 ~ {2}
       5:                  101 ~ {1,3}
      10:                 1010 ~ {2,4}
      17:                10001 ~ {1,5}
      33:               100001 ~ {1,6}
      65:              1000001 ~ {1,7}
     129:             10000001 ~ {1,8}
     257:            100000001 ~ {1,9}
     514:           1000000010 ~ {2,10}
    1027:          10000000011 ~ {1,2,11}
    2049:         100000000001 ~ {1,12}
    4097:        1000000000001 ~ {1,13}
    8193:       10000000000001 ~ {1,14}
   16385:      100000000000001 ~ {1,15}
   32770:     1000000000000010 ~ {2,16}
   65537:    10000000000000001 ~ {1,17}
  131073:   100000000000000001 ~ {1,18}
  262145:  1000000000000000001 ~ {1,19}
  524289: 10000000000000000001 ~ {1,20}
		

Crossrefs

For primes instead of powers of two we have A112926, opposite A112925, sum A373197, length A373198.
Counting zeros instead of all bits gives A372473, firsts of A372472.
These are squarefree numbers at indices A372540, firsts of A372475.
Counting ones instead of all bits gives A372541, firsts of A372433.
The opposite (greatest squarefree number <= 2^n) is A372889.
The difference from 2^n is A373125.
For prime instead of squarefree we have:
- bits A372684, firsts of A035100
- zeros A372474, firsts of A035103
- ones A372517, firsts of A014499
A000120 counts ones in binary expansion (binary weight), zeros A080791.
A005117 lists squarefree numbers.
A030190 gives binary expansion, reversed A030308, length A070939 or A029837.
A061398 counts squarefree numbers between primes (exclusive).
A077643 counts squarefree terms between powers of 2, run-lengths of A372475.
A143658 counts squarefree numbers up to 2^n.

Programs

  • Mathematica
    Table[NestWhile[#+1&,2^n,!SquareFreeQ[#]&],{n,0,10}]
  • PARI
    a(n) = my(k=2^n); while (!issquarefree(k), k++); k; \\ Michel Marcus, May 29 2024
    
  • Python
    from itertools import count
    from sympy import factorint
    def A372683(n): return next(i for i in count(1<Chai Wah Wu, Aug 26 2024

Formula

a(n) = A005117(A372540(n)).
a(n) = A067535(2^n). - R. J. Mathar, May 31 2024

A372475 Length of binary expansion (or number of bits) of the n-th squarefree number.

Original entry on oeis.org

1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8
Offset: 1

Views

Author

Gus Wiseman, May 09 2024

Keywords

Examples

			The 10th squarefree number is 14, with binary expansion (1,1,1,0), so a(10) = 4.
		

Crossrefs

For prime instead of squarefree we have A035100, 1's A014499, 0's A035103.
Restriction of A070939 to A005117.
Run-lengths are A077643.
For weight instead of length we have A372433 (restrict A000120 to A005117).
For zeros instead of length we have A372472, firsts A372473.
Positions of first appearances are A372540.
A030190 gives binary expansion, reversed A030308.
A048793 lists positions of ones in reversed binary expansion, sum A029931.
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
    IntegerLength[Select[Range[1000],SquareFreeQ],2]
  • Python
    from math import isqrt
    from sympy import mobius
    def A372475(n):
        def f(x): return n+x-sum(mobius(k)*(x//k**2) for k in range(1, isqrt(x)+1))
        m, k = n, f(n)
        while m != k:
            m, k = k, f(k)
        return int(m).bit_length() # Chai Wah Wu, Aug 02 2024

Formula

a(n) = A070939(A005117(n)).
a(n) = A372472(n) + A372433(n).

A372540 Least k such that the k-th squarefree number has binary expansion of length n. Index of the smallest squarefree number >= 2^n.

Original entry on oeis.org

1, 2, 4, 7, 12, 21, 40, 79, 158, 315, 625, 1246, 2492, 4983, 9963, 19921, 39845, 79689, 159361, 318726, 637462, 1274919, 2549835, 5099651, 10199302, 20398665, 40797328, 81594627, 163189198, 326378285, 652756723, 1305513584, 2611027095, 5222054082, 10444108052
Offset: 0

Views

Author

Gus Wiseman, May 10 2024

Keywords

Examples

			The squarefree numbers A005117(a(n)) together with their binary expansions and binary indices begin:
       1:                  1 ~ {1}
       2:                 10 ~ {2}
       5:                101 ~ {1,3}
      10:               1010 ~ {2,4}
      17:              10001 ~ {1,5}
      33:             100001 ~ {1,6}
      65:            1000001 ~ {1,7}
     129:           10000001 ~ {1,8}
     257:          100000001 ~ {1,9}
     514:         1000000010 ~ {2,10}
    1027:        10000000011 ~ {1,2,11}
    2049:       100000000001 ~ {1,12}
    4097:      1000000000001 ~ {1,13}
    8193:     10000000000001 ~ {1,14}
   16385:    100000000000001 ~ {1,15}
   32770:   1000000000000010 ~ {2,16}
   65537:  10000000000000001 ~ {1,17}
  131073: 100000000000000001 ~ {1,18}
		

Crossrefs

Counting zeros instead of length gives A372473, firsts of A372472.
For prime instead of squarefree we have:
- zeros A372474, firsts of A035103
- ones A372517, firsts of A014499
- bits A372684, firsts of A035100
Positions of first appearances in A372475, run-lengths A077643.
For weight instead of length we have A372541, firsts of A372433.
Indices of the squarefree numbers listed by A372683.
A000120 counts ones in binary expansion (binary weight), zeros A080791.
A005117 lists squarefree numbers.
A030190 gives binary expansion, reversed A030308.
A070939 counts bits, binary length, or length of binary expansion.

Programs

  • Mathematica
    nn=1000;
    ssnm[y_]:=Max@@NestWhile[Most,y,Union[#]!=Range[Max@@#]&];
    dcs=IntegerLength[Select[Range[nn],SquareFreeQ],2];
    Table[Position[dcs,i][[1,1]],{i,ssnm[dcs]}]
  • Python
    from itertools import count
    from math import isqrt
    from sympy import mobius, factorint
    def A372540(n): return next(sum(mobius(a)*(k//a**2) for a in range(1, isqrt(k)+1)) for k in count(1<Chai Wah Wu, May 12 2024

Formula

A005117(a(n)) = A372683(n).
a(n) = A143658(n)+1 for n > 1. - Chai Wah Wu, Aug 26 2024

Extensions

a(24)-a(34) from Chai Wah Wu, May 12 2024

A372474 Least k such that the k-th prime number has exactly n zeros in its binary expansion.

Original entry on oeis.org

2, 1, 8, 7, 19, 32, 99, 55, 174, 310, 565, 1029, 1902, 3513, 6544, 6543, 23001, 43395, 82029, 155612, 295957, 564164, 1077901, 3957811, 3965052, 7605342, 14630844, 28194383, 54400029, 105097568, 393615809, 393615807, 762939128, 1480206930, 2874398838, 5586502349
Offset: 0

Views

Author

Gus Wiseman, May 11 2024

Keywords

Examples

			The prime numbers A000040(a(n)) together with their binary expansions and binary indices begin:
         3:                          11 ~ {1,2}
         2:                          10 ~ {2}
        19:                       10011 ~ {1,2,5}
        17:                       10001 ~ {1,5}
        67:                     1000011 ~ {1,2,7}
       131:                    10000011 ~ {1,2,8}
       523:                  1000001011 ~ {1,2,4,10}
       257:                   100000001 ~ {1,9}
      1033:                 10000001001 ~ {1,4,11}
      2053:                100000000101 ~ {1,3,12}
      4099:               1000000000011 ~ {1,2,13}
      8209:              10000000010001 ~ {1,5,14}
     16417:             100000000100001 ~ {1,6,15}
     32771:            1000000000000011 ~ {1,2,16}
     65539:           10000000000000011 ~ {1,2,17}
     65537:           10000000000000001 ~ {1,17}
    262147:         1000000000000000011 ~ {1,2,19}
    524353:        10000000000001000001 ~ {1,7,20}
   1048609:       100000000000000100001 ~ {1,6,21}
   2097169:      1000000000000000010001 ~ {1,5,22}
   4194433:     10000000000000010000001 ~ {1,8,23}
   8388617:    100000000000000000001001 ~ {1,4,24}
  16777729:   1000000000000001000000001 ~ {1,10,25}
  67108913: 100000000000000000000110001 ~ {1,5,6,27}
  67239937: 100000000100000000000000001 ~ {1,18,27}
		

Crossrefs

Positions of first appearances in A035103.
For squarefree instead of prime we have A372473, firsts of A372472.
Counting ones (weight) gives A372517, firsts of A014499.
Counting squarefree bits gives A372540, firsts of A372475, runs A077643.
Counting squarefree ones gives A372541, firsts of A372433.
Counting bits (length) gives A372684, firsts of A035100.
A000120 counts ones in binary expansion (binary weight), zeros A080791.
A030190 gives binary expansion, reversed A030308.
A048793 lists positions of ones in reversed binary expansion, sum A029931.
A070939 gives length of binary expansion (number of bits).

Programs

  • Mathematica
    nn=10000;
    spnm[y_]:=Max@@NestWhile[Most,y,Union[#]!=Range[0,Max@@#]&];
    dcs=DigitCount[Select[Range[nn],PrimeQ],2,0];
    Table[Position[dcs,i][[1,1]],{i,0,spnm[dcs]}]
  • Python
    from itertools import count
    from sympy import isprime, primepi
    from sympy.utilities.iterables import multiset_permutations
    def A372474(n):
        for l in count(n):
            m = 1<Chai Wah Wu, May 13 2024

Formula

a(n) = A000720(A066195(n)). - Robert Israel, May 13 2024

Extensions

a(22)-a(35) from and offset corrected by Chai Wah Wu, May 13 2024

A373125 Difference between 2^n and the least squarefree number >= 2^n.

Original entry on oeis.org

0, 0, 1, 2, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 3, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 3, 3, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1
Offset: 0

Views

Author

Gus Wiseman, May 28 2024

Keywords

Crossrefs

For prime instead of squarefree we have A092131, opposite A013603.
For primes instead of powers of 2: A240474, A240473, A112926, A112925.
Difference between 2^n and A372683(n).
The opposite is A373126, delta of A372889.
A005117 lists squarefree numbers, first differences A076259.
A053797 gives lengths of gaps between squarefree numbers.
A061398 counts squarefree numbers between primes (exclusive).
A070939 or (preferably) A029837 gives length of binary expansion.
A077643 counts squarefree terms between powers of 2, run-lengths of A372475.
A143658 counts squarefree numbers up to 2^n.
Cf. A372473 (firsts of A372472), A372541 (firsts of A372433).
For primes between powers of 2:
- sum A293697 (except initial terms)
- length A036378
- min A104080 or A014210, indices A372684 (firsts of A035100)
- max A014234, delta A013603

Programs

  • Mathematica
    Table[NestWhile[#+1&,2^n,!SquareFreeQ[#]&]-2^n,{n,0,100}]

Formula

a(n) = A372683(n)-2^n. - R. J. Mathar, May 31 2024

A372472 Number of zeros in the binary expansion of the n-th squarefree number.

Original entry on oeis.org

0, 1, 0, 1, 1, 0, 2, 1, 1, 1, 0, 3, 2, 2, 2, 1, 2, 1, 1, 0, 4, 4, 3, 3, 3, 2, 3, 3, 2, 2, 1, 2, 2, 1, 2, 2, 1, 1, 1, 5, 5, 4, 4, 4, 3, 4, 4, 3, 3, 2, 4, 3, 3, 3, 2, 3, 2, 2, 2, 1, 4, 3, 3, 2, 3, 3, 2, 2, 2, 1, 3, 3, 2, 2, 1, 2, 1, 0, 6, 6, 5, 5, 5, 5, 5, 4, 4
Offset: 1

Views

Author

Gus Wiseman, May 09 2024

Keywords

Examples

			The 12th squarefree number is 17, with binary expansion (1,0,0,0,1), so a(12) = 3.
		

Crossrefs

Positions of first appearances are A372473.
Restriction of A023416 to A005117.
For prime instead of squarefree we have A035103, ones A014499, bits A035100.
Counting 1's instead of 0's (so restrict A000120 to A005117) gives A372433.
For binary length we have A372475, run-lengths A077643.
A030190 gives binary expansion, reversed A030308.
A048793 lists positions of ones in reversed binary expansion, sum A029931.
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

Formula

a(n) = A023416(A005117(n)).
a(n) + A372433(n) = A070939(A005117(n)) = A372475(n).
Showing 1-10 of 15 results. Next