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

A378356 Prime index of the next prime after the n-th perfect power.

Original entry on oeis.org

1, 3, 5, 5, 7, 10, 10, 12, 12, 16, 19, 23, 26, 31, 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
Offset: 1

Views

Author

Gus Wiseman, Dec 05 2024

Keywords

Crossrefs

First differences are A080769.
Union is A378365.
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.
A377432 counts perfect powers between primes, see A377434, A377436, A377466.
A378249 gives the least perfect power > prime(n), restriction of A377468.

Programs

  • Mathematica
    Table[PrimePi[NextPrime[n]],{n,Select[Range[1000],perpowQ]}]

Formula

a(n) = A000720(A001597(n)) + 1.

A378355 Numbers appearing exactly once in A378035 (greatest perfect power < prime(n)).

Original entry on oeis.org

125, 216, 243, 64000, 1295029, 2535525316, 542939080312
Offset: 1

Views

Author

Gus Wiseman, Nov 26 2024

Keywords

Comments

These are perfect-powers p such that the interval from p to the next perfect power contains a unique prime.
Is this sequence infinite? See A178700.

Examples

			We have 125 because 127 is the only prime between 125 and 128.
		

Crossrefs

The next prime is A178700.
Singletons in A378035 (union A378253), restriction of A081676.
The next perfect power is A378374.
Swapping primes and perfect powers gives A379154, unique case of A377283.
A000040 lists the primes, differences A001223.
A001597 lists the perfect powers, differences A053289.
A007916 lists the not perfect powers, differences A375706.
A069623 counts perfect powers <= n.
A076411 counts perfect powers < n.
A377432 counts perfect powers between primes, see A377434, A377436, A377466.
A378249 gives least perfect power > prime(n) (run-lengths A378251), restrict of A377468.

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

A151800(a(n)) = A178700(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}.
Showing 1-6 of 6 results.