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-8 of 8 results.

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

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

A379157 Prime powers p such that the interval from p to the next prime power contains a unique prime number.

Original entry on oeis.org

3, 4, 7, 9, 13, 16, 23, 27, 31, 32, 47, 49, 61, 64, 79, 81, 113, 125, 127, 128, 167, 169, 241, 243, 251, 256, 283, 289, 337, 343, 359, 361, 509, 512, 523, 529, 619, 625, 727, 729, 839, 841, 953, 961, 1021, 1024, 1327, 1331, 1367, 1369, 1669, 1681, 1847, 1849
Offset: 1

Views

Author

Gus Wiseman, Dec 22 2024

Keywords

Examples

			The next prime power after 32 is 37, with interval (32,33,34,35,36,37) containing just one prime 37, so 32 is in the sequence.
		

Crossrefs

For no primes we have A068315/A379156, for perfect powers A116086/A274605.
The previous instead of next prime power we have A175106.
For perfect powers instead of prime powers we have A378355.
The positions of these prime powers (in A246655) are A379155.
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.
A065514 gives the greatest prime power < prime(n), difference A377289.
A246655 lists the prime powers.
A366833 counts prime powers between primes, see A053607, A304521.
A366835 counts primes between prime powers, for perfect powers A080769.

Programs

  • Mathematica
    v=Select[Range[100],PrimePowerQ]
    nextpripow[n_]:=NestWhile[#+1&,n+1,!PrimePowerQ[#]&]
    Select[v,Length[Select[Range[#,nextpripow[#]],PrimeQ]]==1&]

Formula

a(n) = A246655(A379155(n)).

A378253 Perfect powers p such that there are no other perfect powers between p and the least prime > p.

Original entry on oeis.org

1, 4, 9, 16, 27, 36, 49, 64, 81, 100, 125, 128, 144, 169, 196, 216, 225, 243, 256, 289, 324, 343, 361, 400, 441, 484, 512, 529, 576, 625, 676, 729, 784, 841, 900, 961, 1000, 1024, 1089, 1156, 1225, 1296, 1331, 1369, 1444, 1521, 1600, 1681, 1728, 1764, 1849
Offset: 1

Views

Author

Gus Wiseman, Nov 26 2024

Keywords

Comments

Perfect powers (A001597) are 1 and numbers with a proper integer root, complement A007916.
Each term is the greatest perfect power < prime(k) for some k.

Examples

			The first number line below shows the perfect powers. The second shows each prime. To get a(n), we take the last perfect power in each interval between consecutive primes, omitting 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

Union of A378035, restriction of A081676 to the primes.
The opposite is A378250, union of A378249 (run-lengths A378251).
A000040 lists the primes, differences A001223.
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.
A080769 counts primes between perfect powers.
A377283 ranks perfect powers between primes, differences A378356.
A377432 counts perfect powers between primes, see A377434, A377436, A377466.

Programs

  • Mathematica
    radQ[n_]:=n>1&&GCD@@Last/@FactorInteger[n]==1;
    Union[Table[NestWhile[#-1&,Prime[n],radQ[#]&],{n,1000}]]

A378368 Positions (in A001597) of consecutive perfect powers with a unique prime between them.

Original entry on oeis.org

15, 20, 22, 295, 1257
Offset: 1

Views

Author

Gus Wiseman, Dec 17 2024

Keywords

Comments

Perfect powers (A001597) are 1 and numbers with a proper integer root.
The perfect powers themselves are given by A001597(a(n)) = A378355(n).

Examples

			The 15th and 16th perfect powers are 125 and 128, and 127 is the only prime between them, so 15 is in the sequence.
		

Crossrefs

These are the positions of 1 in A080769.
The next prime after A001597(a(n)) is A178700(n).
For no (instead of one) perfect powers we have A274605.
Swapping 'prime' and 'perfect power' gives A377434, unique case of A377283.
The next perfect power after A001597(a(n)) is A378374(n).
For prime powers instead of perfect powers we have A379155.
A000040 lists the primes, differences A001223.
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.
A081676 gives the greatest perfect power <= n.
A377432 counts perfect powers between primes, see A377436, A377466.
A377468 gives the least perfect power > n.

Programs

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

Formula

We have A001597(a(n)) = A378355(n) < A178700(n) < A378374(n).

A378374 Perfect powers p such that the interval from the previous perfect power to p contains a unique prime.

Original entry on oeis.org

128, 225, 256, 64009, 1295044
Offset: 1

Views

Author

Gus Wiseman, Dec 17 2024

Keywords

Comments

Also numbers appearing exactly once in A378249.

Examples

			The consecutive perfect powers 125 and 128 have interval (125, 126, 127, 128) with unique prime 127, so 128 is in the sequence.
		

Crossrefs

The previous prime is A178700.
For prime powers instead of perfect powers we have A345531, difference A377281.
Opposite singletons in A378035 (union A378253), restriction of A081676.
For squarefree numbers we have A378082, see A377430, A061398, A377431, A068360.
Singletons in A378249 (run-lengths A378251), restriction of A377468 to the primes.
If the same interval contains at least one prime we get A378250.
For next instead of previous perfect power we have A378355.
Swapping "prime" with "perfect power" gives A378364.
A000040 lists the primes, differences A001223.
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.
A080769 counts primes between perfect powers.

Programs

  • Mathematica
    radQ[n_]:=n>1&&GCD@@Last/@FactorInteger[n]==1;
    y=Table[NestWhile[#+1&,Prime[n],radQ[#]&],{n,1000}];
    Select[Union[y],Count[y,#]==1&]

Formula

We have a(n) < A178700(n) < A378355(n).

A378365 Next prime index after each perfect power, duplicates removed.

Original entry on oeis.org

1, 3, 5, 7, 10, 12, 16, 19, 23, 26, 31, 32, 35, 40, 45, 48, 49, 54, 55, 62, 67, 69, 73, 79, 86, 93, 98, 100, 106, 115, 123, 130, 138, 147, 155, 163, 169, 173, 182, 192, 201, 211, 218, 220, 229, 241, 252, 264, 270, 275, 284, 296, 307, 310, 320, 328, 330, 343
Offset: 1

Views

Author

Gus Wiseman, Nov 26 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 n at position prime(n). To get a(n), we take the first prime between each pair of consecutive perfect powers, skipping the cases where there are none.
-1-----4-------8-9------------16----------------25--27--------32------36----
===1=2===3===4=======5===6=======7===8=======9==========10==11==========12==
		

Crossrefs

The opposite version is A377283.
Positions of first appearances in A378035.
First differences are A378251.
Union of A378356.
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.
A080769 counts primes between perfect powers.
A377432 counts perfect powers between primes, see A377434, A377436, A377466.
A378249 gives the least perfect power > prime(n), restriction of A377468.

Programs

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

Formula

These are the distinct elements of the set {1 + A000720(A151800(n)), n>0}.

A379154 Prime numbers p such that the interval from p to the next prime number contains a unique perfect power.

Original entry on oeis.org

3, 13, 47, 61, 79, 97, 127, 139, 167, 193, 211, 223, 241, 251, 283, 317, 337, 359, 397, 439, 479, 509, 523, 571, 619, 673, 727, 773, 839, 887, 953, 997, 1021, 1087, 1153, 1223, 1291, 1327, 1367, 1439, 1511, 1597, 1669, 1723, 1759, 1847, 1933, 2017, 2039, 2113
Offset: 1

Views

Author

Gus Wiseman, Dec 18 2024

Keywords

Comments

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

Examples

			The prime after 13 is 17, and the interval (13,14,15,16,17) contains only one perfect power 16, so 13 is in the sequence.
		

Crossrefs

The indices of these primes are one plus the positions of 1 in A377432.
For zero instead of one perfect power we have the primes indexed by A377436.
The indices of these primes are A377434.
Swapping "prime" with "perfect power" gives A378355, indices A378368.
For previous instead of next prime we have A378364.
A000040 lists the primes, differences A001223.
A001597 lists the perfect powers, differences A053289.
A007916 lists the non perfect powers, differences A375706.
A081676 gives the greatest perfect power <= n.
A116086 gives perfect powers with no primes between them and the next perfect power.
A366833 counts prime powers between primes, see A053607, A304521.
A377468 gives the least perfect power > n.

Programs

  • Maple
    N:= 10^4: # to get all entries <= N
    S:={seq(seq(a^b, b = 2 .. floor(log[a](N))), a = 2 .. floor(sqrt(N)))}:
    S:= sort(convert(S,list)):
    J:= select(i -> nextprime(S[i]) < S[i+1] and prevprime(S[i]) > S[i-1], [$2..nops(S)-1]):
    J:= [1,op(J)]:
    map(prevprime, S[J]); # Robert Israel, Jan 19 2025
  • Mathematica
    perpowQ[n_]:=n==1||GCD@@FactorInteger[n][[All,2]]>1;
    Select[Range[1000],PrimeQ[#]&&Length[Select[Range[#,NextPrime[#]],perpowQ]]==1&]
  • PARI
    is_a379154(n) = isprime(n) && #select(x->ispower(x), [n+1..nextprime(n+1)-1])==1 \\ Hugo Pfoertner, Dec 19 2024

Formula

a(n) = A151799(A378364(n+1)).
Showing 1-8 of 8 results.