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 26 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

A377432 Number of perfect-powers x in the range prime(n) < x < prime(n+1).

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Oct 31 2024

Keywords

Comments

Perfect-powers (A001597) are numbers with a proper integer root, complement A007916.

Examples

			Between prime(4) = 7 and prime(5) = 11 we have perfect-powers 8 and 9, so a(4) = 2.
		

Crossrefs

For prime-powers instead of perfect-powers we have A080101.
Non-perfect-powers in the same range are counted by A377433.
Positions of 1 are A377434.
Positions of 0 are A377436.
Positions of terms > 1 are A377466.
For powers of 2 instead of primes we have A377467, for prime-powers A244508.
A000040 lists the primes, differences A001223.
A000961 lists the powers of primes, differences A057820.
A001597 lists the perfect-powers, differences A053289.
A007916 lists the non-perfect-powers, differences A375706.
A046933 counts the interval from A008864(n) to A006093(n+1).
A081676 gives the greatest perfect-power <= n.
A246655 lists the prime-powers not including 1, complement A361102.
A366833 counts prime-powers between primes, see A053706, A053607, A304521, A377286.
A377468 gives the least perfect-power > n.

Programs

  • Mathematica
    perpowQ[n_]:=n==1||GCD@@FactorInteger[n][[All,2]]>1;
    Table[Length[Select[Range[Prime[n]+1, Prime[n+1]-1],perpowQ]],{n,100}]

Formula

a(n) + A377433(n) = A046933(n) = prime(n+1) - prime(n) - 1.

A377436 Numbers k such that there is no perfect-power x in the range prime(k) < x < prime(k+1).

Original entry on oeis.org

1, 3, 5, 7, 8, 10, 12, 13, 14, 16, 17, 19, 20, 21, 23, 24, 26, 27, 28, 29, 32, 33, 35, 36, 37, 38, 40, 41, 42, 43, 45, 46, 49, 50, 51, 52, 55, 56, 57, 58, 59, 60, 62, 63, 64, 65, 67, 69, 70, 71, 73, 74, 75, 76, 77, 79, 80, 81, 82, 83, 84, 86, 87, 88, 89, 90
Offset: 1

Views

Author

Gus Wiseman, Nov 02 2024

Keywords

Comments

Perfect-powers (A001597) are numbers with a proper integer root, complement A007916.

Examples

			Primes 8 and 9 are 19 and 23, and the interval (20,21,22) contains no prime-powers, so 8 is in the sequence.
		

Crossrefs

For powers of 2 instead of primes see A377467, A013597, A014210, A014234, A244508.
For squarefree instead of perfect-power we have A068360, see A061398, A377430, A377431.
For just squares (instead of all perfect-powers) we have A221056, primes A224363.
For prime-powers (instead of perfect-powers) we have A377286.
These are the positions of 0 in A377432.
For one instead of none we have A377434, for prime-powers A377287.
For two instead of none we have A377466, for prime-powers A377288, primes A053706.
A000015 gives the least prime-power >= n.
A000040 lists the primes, differences A001223.
A000961 lists the powers of primes, differences A057820.
A046933 counts the interval from A008864(n) to A006093(n+1).
A065514 gives the nearest prime-power before prime(n)-1, difference A377289.
A080101 and A366833 count prime-powers between primes, see A377057, A053607, A304521.
A081676 gives the nearest perfect-power up to n.
A246655 lists the prime-powers not including 1, complement A361102.
A377468 gives the nearest perfect-power after n.

Programs

  • Mathematica
    perpowQ[n_]:=n==1||GCD@@FactorInteger[n][[All,2]]>1;
    Select[Range[100],Length[Select[Range[Prime[#]+1, Prime[#+1]-1],perpowQ]]==0&]

A377430 Numbers k such that there is exactly one squarefree number between prime(k)+1 and prime(k+1)-1.

Original entry on oeis.org

3, 4, 9, 10, 13, 14, 15, 22, 26, 33, 39, 48, 59, 60, 65, 85, 88, 89, 93, 104, 113, 116, 122, 142, 143, 147, 148, 155, 181, 188, 198, 201, 209, 212, 213, 224, 226, 234, 235, 244, 254, 264, 265, 268, 287, 288, 313, 320, 328, 332, 333, 341, 343, 353, 361, 366
Offset: 1

Views

Author

Gus Wiseman, Oct 29 2024

Keywords

Examples

			Primes 4 and 5 are 7 and 11, and the interval (8,9,10) contains only squarefree 10, so 4 is in the sequence.
		

Crossrefs

For composite instead of squarefree we have A029707.
These are the positions of 1 in A061398, or 2 in A373198.
For no squarefree numbers we have A068360.
For prime-power instead of squarefree we have A377287.
For at least one squarefree number we have A377431.
For perfect-power instead of squarefree we have A377434.
A000040 lists the primes, differences A001223, seconds A036263.
A002808 lists the composites, complement A008578.
A005117 lists the squarefree numbers, complement A013929.
A377038 gives k-differences of squarefree numbers.

Programs

  • Maple
    R:= NULL: count:= 0: q:= 2:
    for k from 1 while count < 100 do
      p:= q; q:= nextprime(q);
      if nops(select(numtheory:-issqrfree,[$p+1 .. q-1]))=1 then
        R:= R,k; count:= count+1;
     fi
    od:
    R; # Robert Israel, Nov 29 2024
  • Mathematica
    Select[Range[100], Length[Select[Range[Prime[#]+1,Prime[#+1]-1],SquareFreeQ]]==1&]
  • PARI
    is(n,p=prime(n))=my(q=nextprime(p+1),s); for(k=p+1,q-1, if(issquarefree(k) && s++>1, return(0))); s==1 \\ Charles R Greathouse IV, Nov 29 2024

A377466 Numbers k such that there is more than one perfect power x in the range prime(k) < x < prime(k+1).

Original entry on oeis.org

4, 9, 11, 30, 327, 445, 3512, 7789, 9361, 26519413
Offset: 1

Views

Author

Gus Wiseman, Nov 02 2024

Keywords

Comments

Perfect powers (A001597) are numbers with a proper integer root, the complement of A007916.
Is this sequence finite?
The Redmond-Sun conjecture (see A308658) implies that this sequence is finite. - Pontus von Brömssen, Nov 05 2024

Examples

			Primes 9 and 10 are 23 and 29, and the interval (24,25,26,27,28) contains two perfect powers (25,27), so 9 is in the sequence.
		

Crossrefs

For powers of 2 see A013597, A014210, A014234, A188951, A244508, A377467.
For no prime-powers we have A377286, ones in A080101.
For a unique prime-power we have A377287.
For squarefree numbers see A377430, A061398, A377431, A068360, A224363.
These are the positions of terms > 1 in A377432.
For a unique perfect power we have A377434.
For no perfect powers we have A377436.
A000015 gives the least prime power >= n.
A000040 lists the primes, differences A001223.
A000961 lists the powers of primes, differences A057820.
A001597 lists the perfect powers, differences A053289, seconds A376559.
A007916 lists the non-perfect-powers, differences A375706, seconds A376562.
A046933 counts the interval from A008864(n) to A006093(n+1).
A081676 gives the greatest perfect power <= n.
A131605 lists perfect powers that are not prime-powers.
A246655 lists the prime-powers not including 1, complement A361102.
A366833 counts prime-powers between primes, see A053607, A304521.
A377468 gives the least perfect power > n.

Programs

  • Mathematica
    perpowQ[n_]:=n==1||GCD@@FactorInteger[n][[All,2]]>1;
    Select[Range[100],Count[Range[Prime[#]+1, Prime[#+1]-1],_?perpowQ]>1&]
  • Python
    from itertools import islice
    from sympy import prime
    from gmpy2 import is_power, next_prime
    def A377466_gen(startvalue=1): # generator of terms >= startvalue
        k = max(startvalue,1)
        p = prime(k)
        while (q:=next_prime(p)):
            c = 0
            for i in range(p+1,q):
                if is_power(i):
                    c += 1
                    if c>1:
                        yield k
                        break
            k += 1
            p = q
    A377466_list = list(islice(A377466_gen(),9)) # Chai Wah Wu, Nov 04 2024

Formula

a(n) = A000720(A116086(n)) = A000720(A116455(n)) for n <= 10. This would hold for all n if there do not exist more than two perfect powers between any two consecutive primes, which is implied by the Redmond-Sun conjecture. - Pontus von Brömssen, Nov 05 2024

Extensions

a(10) from Pontus von Brömssen, Nov 04 2024

A377703 First differences of the sequence A345531(k) = least prime-power greater than the k-th prime.

Original entry on oeis.org

1, 3, 1, 5, 3, 3, 4, 2, 6, 1, 9, 2, 4, 2, 10, 2, 3, 7, 2, 6, 2, 8, 8, 4, 2, 4, 2, 4, 8, 7, 9, 2, 10, 2, 6, 6, 4, 2, 10, 2, 10, 2, 4, 2, 12, 12, 4, 2, 4, 6, 2, 2, 13, 7, 6, 2, 6, 4, 2, 6, 18, 4, 2, 4, 14, 6, 6, 6, 4, 6, 2, 12, 6, 4, 6, 8, 4, 8, 10, 2, 10, 2, 6
Offset: 1

Views

Author

Gus Wiseman, Nov 07 2024

Keywords

Comments

What is the union of this sequence? In particular, does it contain 17?

Crossrefs

First differences of A345531.
A000961 lists the powers of primes, differences A057820.
A001597 lists the perfect-powers, differences A053289, seconds A376559.
A007916 lists the non-perfect-powers, differences A375706, seconds A376562.
A024619 lists the non-prime-powers, differences A375735, seconds A376599.
A080101 counts prime-powers between primes (exclusive).
A246655 lists the prime-powers, differences A057820 without first term.
A361102 lists the non-powers of primes, differences A375708.
A366833 counts prime-powers between primes, see A053607, A304521, A377057 (positive), A377286 (zero), A377287 (one), A377288 (two).
A377432 counts perfect-powers between primes, see A377434 (one), A377436 (zero), A377466 (multiple).

Programs

  • Mathematica
    Differences[Table[NestWhile[#+1&, Prime[n]+1,!PrimePowerQ[#]&],{n,100}]]
  • Python
    from sympy import factorint, prime, nextprime
    def A377703(n): return -next(filter(lambda m:len(factorint(m))<=1, count((p:=prime(n))+1)))+next(filter(lambda m:len(factorint(m))<=1, count(nextprime(p)+1))) # Chai Wah Wu, Nov 14 2024

A377283 Nonnegative integers k such that either k = 0 or there is a perfect power x in the range prime(k) < x < prime(k+1).

Original entry on oeis.org

0, 2, 4, 6, 9, 11, 15, 18, 22, 25, 30, 31, 34, 39, 44, 47, 48, 53, 54, 61, 66, 68, 72, 78, 85, 92, 97, 99, 105, 114, 122, 129, 137, 146, 154, 162, 168, 172, 181, 191, 200, 210, 217, 219, 228, 240, 251, 263, 269, 274, 283, 295, 306, 309, 319, 327, 329, 342, 357
Offset: 1

Views

Author

Gus Wiseman, Nov 21 2024

Keywords

Comments

Perfect powers (A001597) are 1 and numbers with a proper integer root, complement A007916.

Examples

			The first number-line below shows the perfect powers. The second shows each positive integer k at position prime(k).
-1-----4-------8-9------------16----------------25--27--------32------36----
===1=2===3===4=======5===6=======7===8=======9==========10==11==========12==
		

Crossrefs

A version for prime powers is A377057, exclusive A377287.
A version for squarefree numbers is A377431.
Positions of positive terms in A377432 (counts perfect powers between primes).
The case of a unique choice is A377434 (a subset).
The complement (no choices) is A377436.
The case of at least two choices is A377466 (a subset).
Positions of last appearances in A378249.
First-differences are A378251.
This is A378365 - 1, union of A378356 - 1.
A000040 lists the primes, differences A001223.
A000961 lists the powers of primes, differences A057820.
A001597 lists the perfect powers, differences A053289.
A007916 lists the non perfect powers, differences A375706.
A069623 counts perfect powers <= n.
A076411 counts perfect powers < n.
A131605 lists perfect powers that are not prime powers.

Programs

  • Mathematica
    perpowQ[n_]:=n==1||GCD@@FactorInteger[n][[All,2]]>1;
    Select[Range[0,100],#==0||Length[Select[Range[Prime[#]+1,Prime[#+1]-1],perpowQ]]>0&]

A378035 Greatest perfect power < prime(n).

Original entry on oeis.org

1, 1, 4, 4, 9, 9, 16, 16, 16, 27, 27, 36, 36, 36, 36, 49, 49, 49, 64, 64, 64, 64, 81, 81, 81, 100, 100, 100, 100, 100, 125, 128, 128, 128, 144, 144, 144, 144, 144, 169, 169, 169, 169, 169, 196, 196, 196, 216, 225, 225, 225, 225, 225, 243, 256, 256, 256, 256
Offset: 1

Views

Author

Gus Wiseman, Nov 23 2024

Keywords

Comments

Perfect powers (A001597) are 1 and numbers with a proper integer root, complement A007916.

Examples

			The first number line below shows the perfect powers.
The second shows each positive integer k at position prime(k).
-1-----4-------8-9------------16----------------25--27--------32------36----
===1=2===3===4=======5===6=======7===8=======9==========10==11==========12==
		

Crossrefs

Restriction of A081676 to the primes.
Positions of last appearances are also A377283.
A version for squarefree numbers is A378032.
The opposite is A378249 (run lengths A378251), restriction of A377468 to the primes.
The union is A378253.
Terms appearing exactly once are A378355.
Run lengths are A378356, first differences of A377283, complement A377436.
A000040 lists the primes, differences A001223.
A000961 lists the powers of primes, differences A057820.
A001597 lists the perfect powers, differences A053289.
A007916 lists the nonperfect powers, differences A375706.
A069623 counts perfect powers <= n.
A076411 counts perfect powers < n.
A080769 counts primes between perfect powers, prime powers A067871.
A131605 lists perfect powers that are not prime powers.
A377432 counts perfect powers between primes, zeros A377436, postpositives A377466.

Programs

  • Mathematica
    radQ[n_]:=n>1&&GCD@@Last/@FactorInteger[n]==1;
    Table[NestWhile[#-1&,Prime[n],radQ[#]&],{n,100}]
  • PARI
    a(n) = my(k=prime(n)-1); while (!(ispower(k) || (k==1)), k--); k; \\ Michel Marcus, Nov 25 2024
    
  • Python
    from sympy import mobius, integer_nthroot, prime
    def A378035(n):
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        def f(x): return int(x-1+sum(mobius(k)*(integer_nthroot(x,k)[0]-1) for k in range(2,x.bit_length())))
        m = (p:=prime(n)-1)-f(p)
        return bisection(lambda x:f(x)+m,m,m) # Chai Wah Wu, Nov 25 2024

A378249 Least perfect power > prime(n).

Original entry on oeis.org

4, 4, 8, 8, 16, 16, 25, 25, 25, 32, 32, 49, 49, 49, 49, 64, 64, 64, 81, 81, 81, 81, 100, 100, 100, 121, 121, 121, 121, 121, 128, 144, 144, 144, 169, 169, 169, 169, 169, 196, 196, 196, 196, 196, 216, 216, 216, 225, 243, 243, 243, 243, 243, 256, 289, 289, 289
Offset: 1

Views

Author

Gus Wiseman, Nov 21 2024

Keywords

Comments

Perfect-powers (A001597) are numbers with a proper integer root, complement A007916.
Which terms appear only once? Just 128, 225, 256, 64009, 1295044?

Examples

			The first number line below shows the perfect powers. The second shows each prime.
-1-----4-------8-9------------16----------------25--27--------32------36------------------------49--
===2=3===5===7======11==13======17==19======23==========29==31==========37======41==43======47======
		

Crossrefs

A version for prime powers (but starting with prime(k) + 1) is A345531.
Positions of last appearances are A377283, complement A377436.
Restriction of A377468 to the primes, for prime powers A000015.
The opposite is A378035, restriction of A081676.
The union is A378250.
Run lengths are A378251.
A000040 lists the primes, differences A001223.
A000961 lists the powers of primes, differences A057820.
A001597 lists the perfect powers, differences A053289, seconds A376559.
A007916 lists numbers that are not perfect powers, differences A375706, seconds A376562.
A069623 counts perfect powers <= n.
A076411 counts perfect powers < n.
A131605 lists perfect powers that are not prime powers.
A377432 counts perfect powers between primes, zeros A377436, postpositives A377466.

Programs

  • Mathematica
    radQ[n_]:=n>1&&GCD@@Last/@FactorInteger[n]==1;
    Table[NestWhile[#+1&,Prime[n],radQ[#]&],{n,100}]
  • PARI
    f(p) = p++; while(!ispower(p), p++); p;
    lista(nn) = apply(f, primes(nn)); \\ Michel Marcus, Dec 19 2024

A378251 Number of primes between consecutive perfect powers, zeros omitted.

Original entry on oeis.org

2, 2, 2, 3, 2, 4, 3, 4, 3, 5, 1, 3, 5, 5, 3, 1, 5, 1, 7, 5, 2, 4, 6, 7, 7, 5, 2, 6, 9, 8, 7, 8, 9, 8, 8, 6, 4, 9, 10, 9, 10, 7, 2, 9, 12, 11, 12, 6, 5, 9, 12, 11, 3, 10, 8, 2, 13, 15, 10, 11, 15, 7, 9, 12, 13, 11, 12, 17, 2, 11, 16, 16, 13, 17, 15, 14, 16, 15
Offset: 1

Views

Author

Gus Wiseman, Nov 23 2024

Keywords

Comments

First differences of A377283 and A378365. Run-lengths of A378035 and A378249.
Perfect powers (A001597) are 1 and numbers with a proper integer root, complement A007916.

Examples

			The first number line below shows the perfect powers. The second shows each prime. To get a(n) we count the primes between consecutive perfect powers, skipping the cases where there are none.
-1-----4-------8-9------------16----------------25--27--------32------36----
===2=3===5===7======11==13======17==19======23==========29==31==========37==
		

Crossrefs

Same as A080769 with 0's removed (which were at positions A274605).
First differences of A377283 and A378365 (union of A378356).
Run-lengths of A378035 (union A378253) and A378249 (union A378250).
The version for nonprime prime powers is A378373, with zeros A067871.
A000040 lists the primes, differences A001223.
A000961 lists the powers of primes, differences A057820.
A001597 lists the perfect powers, differences A053289, run-lengths of A377468.
A007916 lists the non-perfect powers, differences A375706.
A069623 counts perfect powers <= n.
A076411 counts perfect powers < n.
A131605 lists perfect powers that are not prime powers.
A377432 counts perfect powers between primes, see A377434, A377436, A377466.

Programs

  • Maple
    N:= 10^6: # to use perfect powers up to N
    PP:= {1,seq(seq(i^j,j=2..ilog[i](N)),i=2..isqrt(N))}:
    PP:= sort(convert(PP,list)):
    M:= map(numtheory:-pi, PP):
    subs(0=NULL, M[2..-1]-M[1..-2]): # Robert Israel, Jan 23 2025
  • Mathematica
    radQ[n_]:=n>1&&GCD@@Last/@FactorInteger[n]==1;
    Length/@Split[Table[NestWhile[#+1&,Prime[n],radQ[#]&],{n,100}]]
Showing 1-10 of 26 results. Next