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

A080101 Number of prime powers in all composite numbers between n-th prime and next prime.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Jan 28 2003

Keywords

Comments

The maximum value of terms in the sequence, through the (10^5)th term, is 2. - Harvey P. Dale, Aug 24 2014
This is conjectured to be the maximum, see also A366833. - Gus Wiseman, Nov 06 2024

Examples

			There are two prime powers between 2179 = A000040(327) and 2203 = A000040(328): 2187 = 3^7 and 2197 = 13^3, therefore a(327) = 2, A080102(327) = 2187 and A080103(327) = 2197.
		

Crossrefs

For powers of 2 instead of primes we have A244508, see also A013597, A014210, A014234, A304521.
Adding one gives A366833.
For non-prime-powers instead of prime-powers we have A368748.
Positions of positive terms are A377057, primes A053607.
Positions of 0 are A377286.
Positions of 1 are A377287.
Positions of 2 are A377288, primes A053706.
For perfect-powers (instead of prime-powers) we have A377432.
A000015 gives the least prime-power >= n, difference A377282.
A000040 lists the primes, differences A001223.
A000961 lists the powers of primes, differences A057820, seconds A376596.
A031218 gives the greatest prime-power <= n, difference A276781.
A046933(n) counts the interval from A008864(n) to A006093(n+1).
A065514 gives the greatest prime-power < prime(n), difference A377289.
A246655 lists the prime-powers not including 1, complement A361102.
A345531 gives the least prime-power > prime(n), difference A377281.

Programs

  • Maple
    a := proc(n) local c, k, p: c, p := 0, ithprime(n): for k from p+1 to nextprime(p)-1 do if nops(numtheory:-factorset(k)) = 1 then c := c+1: fi: od: c: end:
    seq(a(n), n = 1 .. 105); # Lorenzo Sauras Altuzarra, Jul 08 2022
  • Mathematica
    prpwQ[n_]:=Module[{fi=FactorInteger[n]},Length[fi]==1&&fi[[1,2]]>1]; nn=600;With[{pwrs=Table[If[prpwQ[n],1,0],{n,nn}]},Table[Total[ Take[ pwrs,{Prime[n],Prime[n+1]}]],{n,PrimePi[nn]-1}]] (* Harvey P. Dale, Aug 24 2014 *)
    Table[Length[Select[Range[Prime[n]+1,Prime[n+1]-1],PrimePowerQ]],{n,30}] (* Gus Wiseman, Nov 06 2024 *)

Formula

a(n) = A366833(n) - 1. - Gus Wiseman, Nov 06 2024

A377289 Difference between prime(n) and the previous prime-power (exclusive).

Original entry on oeis.org

1, 1, 1, 2, 2, 2, 1, 2, 4, 2, 2, 5, 4, 2, 4, 4, 6, 2, 3, 4, 2, 6, 2, 6, 8, 4, 2, 4, 2, 4, 2, 3, 6, 2, 10, 2, 6, 6, 4, 4, 6, 2, 10, 2, 4, 2, 12, 12, 4, 2, 4, 6, 2, 8, 1, 6, 6, 2, 6, 4, 2, 4, 14, 4, 2, 4, 14, 6, 4, 2, 4, 6, 6, 6, 6, 4, 6, 8, 4, 8, 10, 2, 10, 2
Offset: 1

Views

Author

Gus Wiseman, Oct 23 2024

Keywords

Examples

			The twelfth prime is 37, with previous prime-power 32, so a(12) = 5.
		

Crossrefs

For powers of two see A013597, A014210, A014234, A244508, A304521.
For prime instead of prime-power we have A075526.
This is the restriction of A276781 (shifted right) to the primes.
For next instead of previous prime-power we have A377281, restriction of A377282.
A000015 gives the least prime-power >= n.
A000040 lists the primes, differences A001223.
A000961 lists the powers of primes, differences A057820, complement A361102.
A031218 gives the greatest prime-power <= n.
A065514 gives the greatest prime-power < prime(n).
A080101 counts prime-powers between primes (exclusive), cf. A377286, A377287, A377288.
A246655 lists the prime-powers not including 1.

Programs

  • Mathematica
    Table[Prime[n]-NestWhile[#-1&, Prime[n]-1,#>1&&!PrimePowerQ[#]&],{n,100}]
  • Python
    from sympy import prime, factorint
    def A377289(n): return (p:=prime(n))-next(filter(lambda m:len(factorint(m))<=1, range(p-1,0,-1))) # Chai Wah Wu, Oct 25 2024

Formula

a(n) = prime(n) - A031218(prime(n)-1).
a(n) = prime(n) - A065514(n).
a(n) = A276781(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&]

A013603 Difference between 2^n and the nearest prime less than or equal to 2^n.

Original entry on oeis.org

0, 1, 1, 3, 1, 3, 1, 5, 3, 3, 9, 3, 1, 3, 19, 15, 1, 5, 1, 3, 9, 3, 15, 3, 39, 5, 39, 57, 3, 35, 1, 5, 9, 41, 31, 5, 25, 45, 7, 87, 21, 11, 57, 17, 55, 21, 115, 59, 81, 27, 129, 47, 111, 33, 55, 5, 13, 27, 55, 93, 1, 57, 25, 59, 49, 5, 19, 23, 19, 35, 231, 93, 69, 35, 97, 15
Offset: 1

Views

Author

James Kilfiger (mapdn(AT)csv.warwick.ac.uk)

Keywords

Comments

If a(n) = 1, then n is prime and 2^n - 1 is a Mersenne prime. - Franz Vrabec, Sep 27 2005
Using the first variant A007917 (rather than A151799) of the prevprime() function, the sequence is well defined for n = 1, with a(1) = 2^1 - prevprime(2^1) = 2 - 2 = 0. - M. F. Hasler, Sep 09 2015
In Mathematica, one can use NextPrime with a second argument of -1 to obtain the next smaller prime. As almost all the powers of 2 are composite, this produces the proper results for most of this sequence. However, NextPrime[2, -1] returns -2 rather than the expected 2, which would consequently mean a(1) = 4 rather than 0. - Alonso del Arte, Dec 10 2016

Crossrefs

Equivalent sequence for next prime: A092131.

Programs

  • Maple
    seq(2^i-prevprime(2^i),i=2..100);
  • Mathematica
    {0} ~Join~ Array[With[{c = 2^#}, c - NextPrime[c, -1]] &, 80, 2] (* Harvey P. Dale, Jul 23 2013 *)
    Table[2^n - Prime[PrimePi[2^n]], {n, 80}] (* Alonso del Arte, Dec 10 2016 *)
  • PARI
    a(n) = 2^n - precprime(2^n); \\ Michel Marcus, Apr 04 2020

Formula

a(n) = A049711(2^n). - R. J. Mathar, Nov 28 2016
a(n) = 2^n - prevprime(2^n) = 2^n - prime(primepi(2^n)). - Alonso del Arte, Dec 10 2016

Extensions

Extended to a(1) = 0 by M. F. Hasler, Sep 09 2015

A377281 Difference between the n-th prime and the next prime-power (exclusive).

Original entry on oeis.org

1, 1, 2, 1, 2, 3, 2, 4, 2, 2, 1, 4, 2, 4, 2, 6, 2, 3, 4, 2, 6, 2, 6, 8, 4, 2, 4, 2, 4, 8, 1, 6, 2, 10, 2, 6, 6, 4, 2, 6, 2, 10, 2, 4, 2, 12, 12, 4, 2, 4, 6, 2, 2, 5, 6, 6, 2, 6, 4, 2, 6, 14, 4, 2, 4, 14, 6, 6, 2, 4, 6, 2, 6, 6, 4, 6, 8, 4, 8, 10, 2, 10, 2, 6
Offset: 1

Views

Author

Gus Wiseman, Oct 23 2024

Keywords

Examples

			The twelfth prime is 37, with next prime-power 41, so a(12) = 4.
		

Crossrefs

For prime instead of prime-power we have A001223.
For powers of two instead of primes we have A013597, A014210, A014234, A244508, A304521.
This is the restriction of A377282 to the prime numbers.
For previous instead of next prime-power we have A377289, restriction of A276781.
A000015 gives the least prime-power >= n.
A000040 lists the primes, differences A001223.
A000961 lists the powers of primes, differences A057820, complement A361102.
A031218 gives the greatest prime-power <= n.
A080101 counts prime-powers between primes (exclusive), cf. A377286, A377287, A377288.
A246655 lists the prime-powers not including 1.

Programs

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

Formula

a(n) = A000015(prime(n)) - prime(n).
a(n) = A345531(n) - prime(n).
a(n) = A377282(prime(n)).

A377287 Numbers k such that there is exactly one prime-power between prime(k)+1 and prime(k+1)-1.

Original entry on oeis.org

2, 6, 11, 15, 18, 22, 31, 39, 53, 54, 61, 68, 72, 97, 99, 114, 129, 146, 162, 172, 217, 219, 263, 283, 309, 329, 357, 409, 445, 487, 519, 564, 609, 656, 675, 705, 811, 847, 882, 886, 1000, 1028, 1163, 1252, 1294, 1381, 1423, 1457, 1523, 1715, 1821, 1877, 1900
Offset: 1

Views

Author

Gus Wiseman, Oct 25 2024

Keywords

Examples

			Primes 18 and 19 are 61 and 67, and the interval (62, 63, 64, 65, 66) contains only the one prime-power 64, so 18 is in the sequence.
		

Crossrefs

The interval from A008864(n) to A006093(n+1) has A046933(n) elements.
For powers of 2 instead of primes see A013597, A014210, A014234, A244508, A304521.
The nearest prime-power before prime(n)-1 is A065514, difference A377289.
The nearest prime-power after prime(n)+1 is A345531, difference A377281.
These are the positions of 1 in A080101, or 2 in A366833.
For at least one prime-power we have A377057, primes A053607.
For no prime-powers we have A377286.
For two prime-powers we have A377288, primes A053706.
For squarefree instead of prime-power see A377430, A061398, A377431, A068360.
A000015 gives the least prime-power >= n.
A000040 lists the primes, differences A001223.
A000961 lists the powers of primes, differences A057820.
A031218 gives the greatest prime-power <= n.
A246655 lists the prime-powers not including 1, complement A361102.

Programs

  • Mathematica
    Select[Range[100],Length[Select[Range[Prime[#]+1,Prime[#+1]-1],PrimePowerQ]]==1&]
  • Python
    from itertools import count, islice
    from sympy import factorint, nextprime
    def A377287_gen(): # generator of terms
        p, q, k = 2, 3, 1
        for k in count(1):
            if sum(1 for i in range(p+1,q) if len(factorint(i))<=1)==1:
                yield k
            p, q = q, nextprime(q)
    A377287_list = list(islice(A377287_gen(),53)) # Chai Wah Wu, Oct 28 2024

A377057 Numbers k such that there is at least one prime-power between prime(k)+1 and prime(k+1)-1.

Original entry on oeis.org

2, 4, 6, 9, 11, 15, 18, 22, 30, 31, 39, 53, 54, 61, 68, 72, 97, 99, 114, 129, 146, 162, 172, 217, 219, 263, 283, 309, 327, 329, 357, 409, 445, 487, 519, 564, 609, 656, 675, 705, 811, 847, 882, 886, 1000, 1028, 1163, 1252, 1294, 1381, 1423, 1457
Offset: 1

Views

Author

Gus Wiseman, Oct 25 2024

Keywords

Examples

			Primes 18 and 19 are 61 and 67, and the interval (62, 63, 64, 65, 66) contains the prime-power 64, so 18 is in the sequence.
		

Crossrefs

The interval from A008864(n) to A006093(n+1) has A046933(n) elements.
For powers of 2 instead of primes see A013597, A014210, A014234, A244508, A304521.
The corresponding primes are A053607.
The nearest prime-power before prime(n)-1 is A065514, difference A377289.
These are the positions of positive terms in A080101, or terms >1 in A366833.
The nearest prime-power after prime(n)+1 is A345531, difference A377281.
For no prime-powers we have A377286.
For exactly one prime-power we have A377287.
For exactly two prime-powers we have A377288, primes A053706.
A000015 gives the least prime-power >= n.
A000040 lists the primes, differences A001223.
A000961 lists the powers of primes, differences A057820.
A031218 gives the greatest prime-power <= n.
A246655 lists the prime-powers not including 1, complement A361102.

Programs

  • Mathematica
    Select[Range[100], Length[Select[Range[Prime[#]+1,Prime[#+1]-1],PrimePowerQ]]>=1&]
  • Python
    from itertools import count, islice
    from sympy import factorint, nextprime
    def A377057_gen(): # generator of terms
        p, q, k = 2, 3, 1
        for k in count(1):
            if any(len(factorint(i))<=1 for i in range(p+1,q)):
                yield k
            p, q = q, nextprime(q)
    A377057_list = list(islice(A377057_gen(),52)) # Chai Wah Wu, Oct 27 2024

Formula

prime(a(n)) = A053607(n).

A377282 Difference between n and the next prime-power (exclusive).

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Oct 23 2024

Keywords

Examples

			The next prime-power after 13 is 16, so a(12) = 3.
		

Crossrefs

For powers of 2 see A013597, A014210, A014234, A244508, A304521.
For prime instead of prime-power we have A013632.
For previous instead of next prime-power we have A276781, restriction A377289.
The restriction to the prime numbers is A377281.
A000015 gives the least prime-power >= n.
A000040 lists the primes, differences A001223.
A000961 lists the powers of primes, differences A057820, complement A361102.
A031218 gives the greatest prime-power <= n.
A080101 counts prime-powers between primes (exclusive), cf. A377286, A377287, A377288.

Programs

  • Mathematica
    Table[NestWhile[#+1&,n+1,!PrimePowerQ[#]&]-n,{n,100}]
  • Python
    from itertools import count
    from sympy import factorint
    def A377282(n): return next(filter(lambda m:len(factorint(m))<=1, count(n+1)))-n # Chai Wah Wu, Oct 25 2024

Formula

a(n) = A000015(n) - n + 1 for n > 1.
a(prime(n)) = A377281(n).

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

Original entry on oeis.org

2, 6, 15, 18, 22, 25, 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, 329, 342, 357, 367, 378, 393, 400
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 4 and 5 are 7 and 11, and the interval (8,9,10) contains two perfect-powers (8,9), so 4 is not in the sequence.
Primes 5 and 6 are 11 and 13, and the interval (12) contains no perfect-powers, so 5 is not in the sequence.
Primes 6 and 7 are 13 and 17, and the interval (14,15,16) contains just one perfect-power (16), so 6 is in the sequence.
		

Crossrefs

For powers of 2 instead of primes see A013597, A014210, A014234, A244508, A377467.
For prime-powers we have A377287.
For squarefree numbers see A377430, A061398, A377431, A068360.
These are the positions of 1 in A377432.
For no perfect-powers we have A377436.
For more than one perfect-power we have A377466.
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.
A031218 gives the greatest prime-power <= n.
A046933 counts the interval from A008864(n) to A006093(n+1).
A065514 gives the greatest prime-power < prime(n), difference A377289.
A081676 gives the greatest perfect-power <= n.
A131605 lists perfect-powers that are not prime-powers.
A345531 gives the least prime-power > prime(n), difference A377281.
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],Length[Select[Range[Prime[#]+1,Prime[#+1]-1],perpowQ]]==1&]

A377783 Least nonsquarefree number > prime(n).

Original entry on oeis.org

4, 4, 8, 8, 12, 16, 18, 20, 24, 32, 32, 40, 44, 44, 48, 54, 60, 63, 68, 72, 75, 80, 84, 90, 98, 104, 104, 108, 112, 116, 128, 132, 140, 140, 150, 152, 160, 164, 168, 175, 180, 184, 192, 196, 198, 200, 212, 224, 228, 232, 234, 240, 242, 252, 260, 264, 270, 272
Offset: 1

Views

Author

Gus Wiseman, Nov 16 2024

Keywords

Comments

No term appears more than twice. Proof: This would require at least 4 consecutive squarefree numbers (3 primes and at least 1 squarefree number between them). But we cannot have more than 3 consecutive squarefree numbers, because otherwise one of them must be divisible by 4, hence not squarefree.

Examples

			The third prime is 5, which is followed by 6, 7, 8, 9, ..., of which 8 is the first nonsquarefree term, so a(3) = 8.
The terms together with their prime indices begin:
    4: {1,1}
    4: {1,1}
    8: {1,1,1}
    8: {1,1,1}
   12: {1,1,2}
   16: {1,1,1,1}
   18: {1,2,2}
   20: {1,1,3}
   24: {1,1,1,2}
   32: {1,1,1,1,1}
   32: {1,1,1,1,1}
   40: {1,1,1,3}
   44: {1,1,5}
   44: {1,1,5}
   48: {1,1,1,1,2}
   54: {1,2,2,2}
   60: {1,1,2,3}
   63: {2,2,4}
   68: {1,1,7}
   72: {1,1,1,2,2}
		

Crossrefs

For squarefree we have A112926 (diffs A378037), opposite A112925 (diffs A378038).
Restriction to the primes of A120327, which has first differences A378039.
For prime-power instead of nonsquarefree (and primes + 1) we have A345531.
First differences are A377784.
The opposite is A378032 (diffs A378034), restriction of A378033 (diffs A378036).
The union is A378040.
Terms appearing only once are A378082.
Terms appearing twice are A378083.
Nonsquarefree numbers that are missing are A378084.
A000040 lists the primes, differences A001223, seconds A036263.
A005117 lists the squarefree numbers.
A013929 lists the nonsquarefree numbers, differences A078147, seconds A376593.
A061398 counts squarefree numbers between primes, zeros A068360.
A061399 counts nonsquarefree numbers between primes, zeros A068361.
A070321 gives the greatest squarefree number up to n.

Programs

  • Mathematica
    Table[NestWhile[#+1&,Prime[n],SquareFreeQ],{n,100}]

Formula

a(n) = A120327(prime(n)).

Extensions

Proof suggested by Amiram Eldar.
Showing 1-10 of 39 results. Next