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 19 results. Next

A061398 Number of squarefree integers between prime(n) and prime(n+1).

Original entry on oeis.org

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

Views

Author

Labos Elemer, Jun 07 2001

Keywords

Examples

			Between 113 and 127 the 6 squarefree numbers are 114, 115, 118, 119, 122, 123, so a(30)=6.
From _Gus Wiseman_, Nov 06 2024: (Start)
The a(n) squarefree numbers for n = 1..16:
  1   2   3   4   5   6   7   8   9   10  11  12  13  14  15  16
  ---------------------------------------------------------------
  .   .   6   10  .   14  .   21  26  30  33  38  42  46  51  55
                      15      22          34  39              57
                                          35                  58
(End)
		

Crossrefs

Cf. A179211. [Reinhard Zumkeller, Jul 05 2010]
Counting all composite numbers (not just squarefree) gives A046933.
The version for nonsquarefree numbers is A061399.
Zeros are A068360.
The version for prime-powers is A080101.
Partial sums are A337030.
The version for non-prime-powers is A368748.
Excluding prime(n+1) from the range gives A373198.
Ones are A377430.
Positives are A377431.
The version for perfect-powers is A377432.
The version for non-perfect-powers is A377433 + 2.
For squarefree numbers (A005117) between primes:
- length is A061398 (this sequence)
- min is A112926
- max is A112925
- sum is A373197
For squarefree numbers between powers of two:
- length is A077643 (except initial terms), partial sums A143658
- min is A372683, difference A373125, indices A372540, firsts of A372475
- max is A372889, difference A373126
- sum is A373123
For primes between powers of two:
- length is A036378
- min is A104080 or A014210, indices A372684 (firsts of A035100)
- max is A014234, difference A013603
- sum is A293697 (except initial terms)

Programs

  • Maple
    p:= 2:
    for n from 1 to 200 do
      q:= nextprime(p);
    A[n]:= nops(select(numtheory:-issqrfree, [$p+1..q-1]));
    p:= q;
    od:
    seq(A[i],i=1..200); # Robert Israel, Jan 06 2017
  • Mathematica
    a[n_] := Count[Range[Prime[n]+1, Prime[n+1]-1], _?SquareFreeQ];
    Array[a, 100] (* Jean-François Alcover, Feb 28 2019 *)
    Count[Range[#[[1]]+1,#[[2]]-1],?(SquareFreeQ[#]&)]&/@Partition[ Prime[ Range[120]],2,1] (* _Harvey P. Dale, Oct 14 2021 *)
  • PARI
    { n=0; q=2; forprime (p=3, prime(1001), a=0; for (i=q+1, p-1, a+=issquarefree(i)); write("b061398.txt", n++, " ", a); q=p ) } \\ Harry J. Smith, Jul 22 2009
    
  • PARI
    a(n) = my(pp=prime(n)+1); sum(k=pp, nextprime(pp)-1, issquarefree(k)); \\ Michel Marcus, Feb 28 2019
    
  • Python
    from math import isqrt
    from sympy import mobius, prime, nextprime
    def A061398(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))-1 # Chai Wah Wu, Jun 01 2024

Formula

a(n) = A013928(A000040(n+1)) - A013928(A000040(n)) - 1. - Robert Israel, Jan 06 2017
a(n) = A373198(n) - 1. - Gus Wiseman, Nov 06 2024

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.

A104080 Smallest prime >= 2^n.

Original entry on oeis.org

2, 2, 5, 11, 17, 37, 67, 131, 257, 521, 1031, 2053, 4099, 8209, 16411, 32771, 65537, 131101, 262147, 524309, 1048583, 2097169, 4194319, 8388617, 16777259, 33554467, 67108879, 134217757, 268435459, 536870923, 1073741827, 2147483659
Offset: 0

Views

Author

Cino Hilliard, Mar 03 2005

Keywords

Crossrefs

Except initial terms and offset, same as A014210 and A203074.
The opposite (greatest prime <= 2^n) is A014234, indices A007053.
The distance from 2^n is A092131, opposite A013603.
Counting zeros instead of both bits gives A372474, cf. A035103, A211997.
Counting ones instead of both bits gives A372517, cf. A014499, A061712.
For squarefree instead of prime we have A372683, cf. A143658, A372540.
The indices of these prime are given by A372684.

Programs

Formula

a(n) = A014210(n), n <> 1. - R. J. Mathar, Oct 14 2008
Sum_{n >= 0} 1/a(n) = A338475 + 1/6 = 1.4070738... (because 1/6 = 1/2 - 1/3). - Bernard Schott, Nov 01 2020
From Gus Wiseman, Jun 03 2024: (Start)
a(n) = A007918(2^n).
a(n) = 2^n + A092131(n).
a(n) = prime(A372684(n)).
(End)

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

A373127 Length of the n-th maximal antirun of squarefree numbers differing by more than one.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Jun 05 2024

Keywords

Comments

The sum of this antirun is given by A373411.
An antirun of a sequence (in this case A005117) is an interval of positions at which consecutive terms differ by more than one.

Examples

			Row-lengths of:
   1
   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
		

Crossrefs

Positions of first appearances are A373128, sorted A373200.
Functional neighbors: A007674, A027833 (partial sums A029707), A120992, A373403, A373408, A373409, A373411.
A005117 lists the squarefree numbers, first differences A076259.
A013929 lists the nonsquarefree numbers, first differences A078147.
A077643 counts squarefree numbers with n bits, sum A373123.

Programs

  • Mathematica
    Length/@Split[Select[Range[100],SquareFreeQ],#1+1!=#2&]

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}]

A372684 Least k such that prime(k) >= 2^n.

Original entry on oeis.org

1, 3, 5, 7, 12, 19, 32, 55, 98, 173, 310, 565, 1029, 1901, 3513, 6543, 12252, 23001, 43391, 82026, 155612, 295948, 564164, 1077872, 2063690, 3957810, 7603554, 14630844, 28192751, 54400029, 105097566, 203280222, 393615807, 762939112, 1480206280, 2874398516, 5586502349
Offset: 1

Views

Author

Gus Wiseman, May 30 2024

Keywords

Examples

			The numbers prime(a(n)) together with their binary expansions and binary indices begin:
        2:                       10 ~ {2}
        5:                      101 ~ {1,3}
       11:                     1011 ~ {1,2,4}
       17:                    10001 ~ {1,5}
       37:                   100101 ~ {1,3,6}
       67:                  1000011 ~ {1,2,7}
      131:                 10000011 ~ {1,2,8}
      257:                100000001 ~ {1,9}
      521:               1000001001 ~ {1,4,10}
     1031:              10000000111 ~ {1,2,3,11}
     2053:             100000000101 ~ {1,3,12}
     4099:            1000000000011 ~ {1,2,13}
     8209:           10000000010001 ~ {1,5,14}
    16411:          100000000011011 ~ {1,2,4,5,15}
    32771:         1000000000000011 ~ {1,2,16}
    65537:        10000000000000001 ~ {1,17}
   131101:       100000000000011101 ~ {1,3,4,5,18}
   262147:      1000000000000000011 ~ {1,2,19}
   524309:     10000000000000010101 ~ {1,3,5,20}
  1048583:    100000000000000000111 ~ {1,2,3,21}
  2097169:   1000000000000000010001 ~ {1,5,22}
  4194319:  10000000000000000001111 ~ {1,2,3,4,23}
  8388617: 100000000000000000001001 ~ {1,4,24}
		

Crossrefs

The opposite (greatest k such that prime(k) <= 2^n) is A007053.
Positions of first appearances in A035100.
The distance from prime(a(n)) to 2^n is A092131.
Counting zeros instead of all bits gives A372474, firsts of A035103.
Counting ones instead of all bits gives A372517, firsts of A014499.
For primes between powers of 2:
- sum A293697
- length A036378
- min A104080 or A014210
- max A014234, delta A013603
For squarefree numbers between powers of 2:
- sum A373123
- length A077643, run-lengths of A372475
- min A372683, delta A373125, indices A372540
- max A372889, delta A373126, indices A143658
For squarefree numbers between primes:
- sum A373197
- length A373198 = A061398 - 1
- min A000040
- max A112925, opposite A112926

Programs

  • Mathematica
    Table[PrimePi[If[n==1,2,NextPrime[2^n]]],{n,30}]
  • PARI
    a(n) = primepi(nextprime(2^n)); \\ Michel Marcus, May 31 2024

Formula

a(n>1) = A007053(n) + 1.
a(n) = A000720(A104080(n)).
prime(a(n)) = A104080(n).
prime(a(n)) - 2^n = A092131(n).

Extensions

More terms from Michel Marcus, May 31 2024

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

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

A373412 Sum of the n-th maximal antirun of nonsquarefree numbers differing by more than one.

Original entry on oeis.org

12, 99, 52, 180, 93, 49, 335, 279, 156, 629, 99, 540, 237, 245, 125, 521, 567, 450, 963, 340, 347, 728, 1386, 1080, 1637, 243, 244, 1511, 1610, 555, 852, 1171, 2142, 960, 985, 1689, 343, 1042, 351, 1068, 724, 732, 1116, 1905, 1980, 2898, 424, 2161, 3150, 2339
Offset: 1

Views

Author

Gus Wiseman, Jun 06 2024

Keywords

Comments

The length of this antirun is given by A373409.
An antirun of a sequence (in this case A013929) is an interval of positions at which consecutive terms differ by more than one.

Examples

			Row-sums of:
   4   8
   9  12  16  18  20  24
  25  27
  28  32  36  40  44
  45  48
  49
  50  52  54  56  60  63
  64  68  72  75
  76  80
  81  84  88  90  92  96  98
  99
		

Crossrefs

The partial sums are a subset of A329472.
Functional neighbors: A068781, A373404, A373405, A373409, A373410, A373411, A373414.
A005117 lists the squarefree numbers, first differences A076259.
A013929 lists the nonsquarefree numbers, first differences A078147.

Programs

  • Mathematica
    Total/@Split[Select[Range[100],!SquareFreeQ[#]&],#1+1!=#2&]//Most
Showing 1-10 of 19 results. Next