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.

Previous Showing 41-50 of 694 results. Next

A377043 The n-th perfect-power A001597(n) minus the n-th power of a prime A000961(n).

Original entry on oeis.org

0, 2, 5, 5, 11, 18, 19, 23, 25, 36, 48, 64, 81, 98, 100, 101, 115, 138, 164, 179, 184, 200, 209, 240, 271, 284, 300, 336, 374, 413, 439, 450, 495, 542, 587, 632, 683, 738, 793, 852, 887, 903, 964, 1029, 1097, 1165, 1194, 1230, 1295, 1370, 1443, 1518, 1561
Offset: 1

Views

Author

Gus Wiseman, Oct 25 2024

Keywords

Comments

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

Crossrefs

Excluding 1 from the powers of primes gives A377044.
A000015 gives the least prime-power >= n.
A031218 gives the greatest 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.
A024619 lists the non-prime-powers, differences A375735, seconds A376599.
A025475 lists numbers that are both a perfect-power and a prime-power.
A080101 counts prime-powers between primes (exclusive).
A106543 lists numbers that are neither a perfect-power nor a prime-power.
A131605 lists perfect-powers that are not prime-powers.
A246655 lists the prime-powers, complement A361102 (differences A375708).
Prime-power runs: A373675, min A373673, max A373674, length A174965.
Prime-power antiruns: A373576, min A120430, max A006549, length A373671.

Programs

  • Mathematica
    perpowQ[n_]:=n==1||GCD@@FactorInteger[n][[All,2]]>1;
    per=Select[Range[1000],perpowQ];
    per-NestList[NestWhile[#+1&,#+1,!PrimePowerQ[#]&]&,1,Length[per]-1]
  • Python
    from sympy import mobius, primepi, integer_nthroot
    def A377043(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(n-1+x+sum(mobius(k)*(integer_nthroot(x,k)[0]-1) for k in range(2,x.bit_length())))
        def g(x): return int(n-1+x-sum(primepi(integer_nthroot(x,k)[0]) for k in range(1,x.bit_length())))
        return bisection(f,n,n)-bisection(g,n,n) # Chai Wah Wu, Oct 27 2024

Formula

a(n) = A001597(n) - A000961(n).

A377044 The n-th perfect-power A001597(n) minus the n-th prime-power A246655(n).

Original entry on oeis.org

-1, 1, 4, 4, 9, 17, 18, 21, 23, 33, 47, 62, 77, 96, 98, 99, 113, 137, 159, 175, 182, 196, 207, 236, 265, 282, 297, 333, 370, 411, 433, 448, 493, 536, 579, 628, 681, 734, 791, 848, 879, 899, 962, 1028, 1094, 1159, 1192, 1220, 1293, 1364, 1437, 1514, 1559, 1591
Offset: 1

Views

Author

Gus Wiseman, Oct 25 2024

Keywords

Comments

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

Crossrefs

Including 1 with the prime-powers gives A377043.
A000015 gives the least prime-power >= n.
A000040 lists the primes, differences A001223.
A000961 lists the powers of primes, differences A057820, A093555, A376596.
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.
A025475 lists numbers that are both a perfect-power and a prime-power.
A031218 gives the greatest prime-power <= n.
A080101 counts prime-powers between primes (exclusive).
A106543 lists numbers that are neither a perfect-power nor a prime-power.
A131605 lists perfect-powers that are not prime-powers.
A246655 lists the prime-powers, complement A361102, A375708.
Prime-power runs: A373675, min A373673, max A373674, length A174965.
Prime-power antiruns: A373576, min A120430, max A006549, length A373671.

Programs

  • Mathematica
    perpowQ[n_]:=n==1||GCD@@FactorInteger[n][[All,2]]>1;
    per=Select[Range[1000],perpowQ];
    per-NestList[NestWhile[#+1&, #+1,!PrimePowerQ[#]&]&,2,Length[per]-1]
  • Python
    from sympy import mobius, primepi, integer_nthroot
    def A377044(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(n-1+x+sum(mobius(k)*(integer_nthroot(x,k)[0]-1) for k in range(2,x.bit_length())))
        def g(x): return int(n+x-sum(primepi(integer_nthroot(x,k)[0]) for k in range(1,x.bit_length())))
        return bisection(f,n,n)-bisection(g,n,n) # Chai Wah Wu, Oct 27 2024

Formula

a(n) = A001597(n) - A246655(n).

A378614 Number of composite numbers (A002808) between consecutive perfect powers (A001597), exclusive.

Original entry on oeis.org

0, 1, 0, 4, 5, 1, 2, 3, 8, 11, 12, 15, 15, 3, 1, 12, 19, 21, 16, 7, 12, 11, 25, 29, 16, 13, 32, 33, 35, 22, 14, 40, 39, 42, 45, 46, 47, 50, 52, 32, 19, 55, 56, 59, 60, 27, 35, 65, 64, 67, 68, 40, 30, 75, 74, 77, 19, 57, 62, 9, 9, 81, 81, 88, 89, 87, 32, 55, 94
Offset: 1

Views

Author

Gus Wiseman, Dec 02 2024

Keywords

Comments

The inclusive version is a(n) + 2.

Examples

			The composite numbers counted by a(n) cover A106543 with the following disjoint sets:
  .
  6
  .
  10 12 14 15
  18 20 21 22 24
  26
  28 30
  33 34 35
  38 39 40 42 44 45 46 48
  50 51 52 54 55 56 57 58 60 62 63
		

Crossrefs

For prime instead of perfect power we have A046933.
For prime instead of composite we have A080769.
For nonsquarefree instead of perfect power we have A378373, for primes A236575.
For nonprime prime power instead of perfect power we have A378456.
A001597 lists the perfect powers, differences A053289.
A002808 lists the composite numbers.
A007916 lists the non perfect powers, differences A375706.
A069623 counts perfect powers <= n.
A076411 counts perfect powers < n.
A106543 lists the composite non perfect powers.
A377432 counts perfect powers between primes, see A377434, A377436, A377466.
A378365 gives the least prime > each perfect power, opposite A377283.

Programs

  • Mathematica
    perpowQ[n_]:=n==1||GCD@@FactorInteger[n][[All,2]]>1;
    v=Select[Range[100],perpowQ[#]&];
    Table[Length[Select[Range[v[[i]]+1,v[[i+1]]-1],CompositeQ]],{i,Length[v]-1}]
  • Python
    from sympy import mobius, integer_nthroot, primepi
    def A378614(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(n+x-1+sum(mobius(k)*(integer_nthroot(x,k)[0]-1) for k in range(2,x.bit_length())))
        return -(a:=bisection(f,n,n))+(b:=bisection(lambda x:f(x)+1,a+1,a+1))-primepi(b)+primepi(a)-1 # Chai Wah Wu, Dec 03 2024

A379961 Numbers k such that A276086(k)-1 is a perfect power (A001597), where A276086 is the primorial base exp-function.

Original entry on oeis.org

1, 4, 6, 7, 13, 35, 212, 2311, 2316, 2322, 2329, 2550, 9241, 30030, 30037, 32341, 32347, 34662, 60066, 512850, 1023367, 223092876, 223092877, 223095199, 223097490, 223097491, 223122913, 446185741, 6469693260, 6479392984
Offset: 1

Views

Author

Antti Karttunen, Jan 24 2025

Keywords

Examples

			A276086(1) = 2, -1 = 1 = A001597(1), thus 1 is included.
A276086(2311) = 26, -1 = 25 = 5^2, thus 2311 is included.
A276086(1023367) = 328510, -1 = 328509 = 69^3, thus 1023367 is included.
		

Crossrefs

Setwise difference A379960 \ A379962.

Programs

  • PARI
    A276086(n) = { my(m=1, p=2); while(n, m *= (p^(n%p)); n = n\p; p = nextprime(1+p)); (m); };
    is_A379961(n) = { my(x=A276086(n)); (1==(x-1) || ispower(x-1)); };

A380337 Number of perfect powers (in A001597) that do not exceed primorial A002110(n).

Original entry on oeis.org

1, 1, 2, 7, 19, 63, 208, 802, 3344, 15576, 82368, 453834, 2743903, 17510668, 114616907, 785002449, 5711892439, 43861741799, 342522899289, 2803468693325, 23621594605383, 201819398349092, 1793794228847381, 16342173067958793, 154171432351500060, 1518411003599957803
Offset: 0

Views

Author

Michael De Vlieger, Jan 21 2025

Keywords

Comments

In other words, A001597(a(n)) is the largest perfect power less than or equal to A002110(n).

Examples

			Let P = A002110 and let s = A001597.
a(0) = 1 since P(0) = 1, and the set s(1) = {1} contains k that do not exceed 1.
a(1) = 1 since P(1) = 2, and the set s(1) = {1} contains k <= 2.
a(2) = 2 since P(2) = 6, and the set s(1..2) = {1, 4} contains k <= 6.
a(3) = 7 since P(3) = 30, and the set s(1..7) = {1, 4, 8, 9, 16, 25, 27} contains k <= 30.
a(4) = 19 since P(4) = 210, and the set s(1..19) = {1, 4, 8, 9, 16, 25, 27, 32, 36, 49, 64, 81, 100, 121, 125, 128, 144, 169, 196} contains k <= 210, etc.
		

Crossrefs

Programs

  • Mathematica
    Map[1 - Sum[MoebiusMu[k]*Floor[#^(1/k) - 1], {k, 2, Floor[Log2[#]]}] &, FoldList[Times, 1, Prime[Range[30]]] ]
  • Python
    from sympy import primorial, mobius, integer_nthroot
    def A380337(n):
        if n == 0: return 1
        p = primorial(n)
        return int(1-sum(mobius(k)*(integer_nthroot(p,k)[0]-1) for k in range(2,p.bit_length()))) # Chai Wah Wu, Jan 23 2025

A380399 The number of nonunitary divisors of n that are perfect powers (A001597).

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 1, 0
Offset: 1

Views

Author

Amiram Eldar, Jan 23 2025

Keywords

Examples

			a(16) = 2 since 16 have 2 nonunitary divisors that are perfect powers, 4 = 2^2 and 8 = 2^3.
a(32) = 3 since 32 have 3 nonunitary divisors that are perfect powers, 4 = 2^3, 8 = 2^3, and 16 = 2^4.
		

Crossrefs

Programs

  • Mathematica
    ppQ[n_] := n == 1 || GCD @@ FactorInteger[n][[;; , 2]] > 1; a[n_] := DivisorSum[n, 1 &, !CoprimeQ[#, n/#] && ppQ[#] &]; Array[a, 100]
  • PARI
    a(n) = sumdiv(n, d, gcd(d, n/d) > 1 && (d == 1 || ispower(d)));

Formula

a(n) = Sum_{d|n, gcd(d, n/d) > 1} [d in A001597], where [] is the Iverson bracket.
a(n) = A091050(n) - A380398(n).
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = A072102 + Sum_{k>=2} mu(k)*(zeta(k)/zeta(k+1) - 1) = Sum_{k>=2} mu(k)*zeta(k)*(1/zeta(k+1)-1) = 0.38105110303589889319..., where mu is the Moebius function (A008683).

A380400 The sum of unitary divisors of n that are perfect powers (A001597).

Original entry on oeis.org

1, 1, 1, 5, 1, 1, 1, 9, 10, 1, 1, 5, 1, 1, 1, 17, 1, 10, 1, 5, 1, 1, 1, 9, 26, 1, 28, 5, 1, 1, 1, 33, 1, 1, 1, 50, 1, 1, 1, 9, 1, 1, 1, 5, 10, 1, 1, 17, 50, 26, 1, 5, 1, 28, 1, 9, 1, 1, 1, 5, 1, 1, 10, 65, 1, 1, 1, 5, 1, 1, 1, 18, 1, 1, 26, 5, 1, 1, 1, 17, 82
Offset: 1

Views

Author

Amiram Eldar, Jan 23 2025

Keywords

Comments

First differs from A360720 at n = 72.
The number of unitary divisors of n that are perfect powers is A380398(n).

Examples

			a(4) = 5 since 4 have 2 unitary divisors that are perfect powers, 1 and 4 = 2^2, and 1 + 4 = 5.
a(72) = 18 since 72 have 3 unitary divisors that are perfect powers, 1, 8 = 2^3, and 9 = 3^2, and 1 + 8 + 9 = 18.
		

Crossrefs

Programs

  • Mathematica
    ppQ[n_] := n == 1 || GCD @@ FactorInteger[n][[;; , 2]] > 1; a[n_] := DivisorSum[n, # &, CoprimeQ[#, n/#] && ppQ[#] &]; Array[a, 100]
  • PARI
    a(n) = sumdiv(n, d, d * (gcd(d, n/d) == 1 && (d == 1 || ispower(d))));

Formula

a(n) = Sum_{d|n, gcd(d, n/d) == 1} d * [d in A001597], where [] is the Iverson bracket.
a(n) <= A360720(n).
a(n) = 1 if and only if n is squarefree (A005117).

A001598 Number of terms in {b(1)..b(n)} relatively prime to b(n), where b(n) = A001597(n).

Original entry on oeis.org

1, 1, 1, 3, 2, 5, 5, 4, 2, 9, 5, 8, 5, 13, 12, 8, 5, 17, 8, 6, 11, 14, 11, 23, 7, 23, 26, 11, 16, 14, 15, 31, 10, 28, 16, 24, 15, 37, 9, 39, 16, 20, 27, 20, 31, 14, 43, 47, 23, 32, 20, 51, 17, 14, 54, 24, 30, 28, 27, 40, 57, 61, 20, 56, 26, 42, 30, 28, 68, 22
Offset: 1

Views

Author

Keywords

References

  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Programs

  • Mathematica
    nn = 10^4; t = Join[{1}, Union[Flatten[Table[n^i, {i, Prime[Range[PrimePi[Log[2, nn]]]]}, {n, 2, nn^(1/i)}]]]]; Table[Count[GCD[Take[t, n], t[[n]]], 1], {n, Length[t]}] (* T. D. Noe, Aug 09 2012 *)

Extensions

a(1) added by T. D. Noe, Aug 09 2012

A072814 Smallest exponents of perfect powers: A001597(n)=A072813(n)^a(n).

Original entry on oeis.org

2, 2, 3, 2, 2, 2, 3, 5, 2, 2, 2, 2, 2, 2, 3, 7, 2, 2, 2, 3, 2, 5, 2, 2, 2, 3, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 11, 2, 7, 3, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 5, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3
Offset: 1

Views

Author

Reinhard Zumkeller, Jul 12 2002

Keywords

Programs

  • Mathematica
    {2}~Join~Map[Function[m, Min@ DeleteCases[#, x_ /; x < 2] &@ Table[Boole[k^# == m] # &@ IntegerExponent[m, k], {k, 2, Floor@ Sqrt@ m}]], Select[Range@ 5000, GCD @@ FactorInteger[#][[All, -1]] > 1 &]] (* Michael De Vlieger, Dec 08 2016 *)

Extensions

Definition corrected by Daniel Forgues, Mar 07 2009
Inserted a(1) = 2 by Gionata Neri, Dec 08 2016

A075073 Numbers k such that k-th perfect power - k is prime: A001597(k) - k is prime.

Original entry on oeis.org

2, 3, 4, 5, 6, 11, 14, 17, 18, 23, 26, 35, 48, 50, 51, 76, 90, 92, 94, 124, 143, 145, 158, 159, 172, 173, 176, 177, 197, 230, 233, 254, 276, 317, 323, 333, 335, 352, 354, 355, 356, 386, 389, 405, 431, 440, 459, 472, 475, 480, 488
Offset: 1

Views

Author

Zak Seidov, Oct 11 2002

Keywords

Examples

			k=3: pp(3)-3 = 8-3 = 5 is prime.
		

Crossrefs

Cf. A001597.

Programs

  • Mathematica
    With[{s = {1}~Join~Select[Range[4, 2*10^5], GCD @@ FactorInteger[#][[All, -1]] > 1 &]}, Select[Range@ Length@ s, PrimeQ[s[[#]] - #] &]] (* Michael De Vlieger, Aug 25 2021 *)
  • PARI
    lista(nn) = {n = 0; for (pn=1, nn, if (pn==1 || ispower(pn), n++; if (isprime(pn - n), print1(n, ", "));););} \\ Michel Marcus, Jun 05 2013

Extensions

Edited by Georg Fischer, Aug 25 2021
Previous Showing 41-50 of 694 results. Next