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

A088363 Local minima of A053707 (first differences of A025475, powers of a prime but not prime).

Original entry on oeis.org

3, 1, 2, 15, 3, 13, 18, 17, 63, 38, 168, 10, 316, 240, 128, 30, 271, 408, 286, 255, 354, 362, 600, 260, 672, 138, 7, 768, 792, 876, 960, 513, 248, 1080, 546, 2328, 1248, 4008, 1392, 751, 2188, 250, 94, 1728, 3528, 3470, 1848, 2460, 3912, 4008, 3063, 2088, 1554
Offset: 1

Views

Author

Klaus Brockhaus, Sep 27 2003

Keywords

Comments

A053707(k) for k = 1 is a term iff A053707(k) <= A053707(k+1); A053707(k) for k > 1 is a term iff A053707(k-1) > A053707(k) and A053707(k) <= A053707(k+1).
A088364 gives the corresponding indices. Local maxima of A053707 are in A088365.

Examples

			The first four terms of A053707 are 3,4,1,7, hence A053707(1) = 3 is the first and A053707(3) = 1 is the second local minimum of A053707.
		

Crossrefs

Programs

  • Maple
    N:= 10^6: # to use values of A025475 up to N
    P:= select(isprime, [2,seq(i,i=3..isqrt(N),2)]):
    B:= sort([1,seq(seq(p^i,i=2..ilog[p](N)),p=P)]):
    DB:= B[2..-1]-B[1..-2]:
    T:= select(t -> DB[t] <= DB[t-1] and DB[t] <= DB[t+1], [$2..nops(DB)-1]):
    DB[[1,op(T)]]; # Robert Israel, Aug 21 2023
  • PARI
    {m=1; k=0; for(n=2,320000,if(matsize(factor(n))[1]==1&&factor(n)[1,2]>1,d=n-m; if((k<2||b>c)&&(!k<1&&d>=c),print1(c,",")); k++; m=n; b=c; c=d))}

A088364 a(n) = index of the n-th local minimum of A053707.

Original entry on oeis.org

1, 3, 6, 9, 13, 16, 19, 21, 26, 28, 30, 33, 37, 39, 43, 48, 50, 53, 56, 61, 63, 66, 68, 70, 73, 75, 78, 80, 82, 86, 90, 94, 96, 98, 102, 105, 108, 112, 115, 119, 124, 128, 132, 134, 136, 139, 141, 144, 146, 148, 150, 152, 156, 158, 160, 165, 168, 171, 173, 176, 180, 182
Offset: 1

Views

Author

Klaus Brockhaus, Sep 27 2003

Keywords

Examples

			The eighth local minimum of A053707 is 17 and occurs at index 21, hence a(8) = 21; A053707(a(8)) = A053707(21) = 17 = A088363(8).
		

Crossrefs

Programs

  • Maple
    N:= 10^6: # to use values of A025475 up to N
    P:= select(isprime, [2,seq(i,i=3..isqrt(N),2)]):
    B:= sort([1,seq(seq(p^i,i=2..ilog[p](N)),p=P)]):
    DB:= B[2..-1]-B[1..-2]:
    T:= select(t -> DB[t] <= DB[t-1] and DB[t] <= DB[t+1], [$2..nops(DB)-1]):
    [1,op(T)]; # Robert Israel, Aug 21 2023
  • PARI
    {m=1; k=0; for(n=2,530000,if(matsize(factor(n))[1]==1&&factor(n)[1,2]>1,d=n-m; if((k<2||b>c)&&(!k<1&&d>=c),print1(k,",")); k++; m=n; b=c; c=d))}

Formula

A053707(a(n)) = A088363(n).

A088365 Local maxima of A053707 (first differences of A025475, powers of a prime but not prime).

Original entry on oeis.org

4, 9, 17, 40, 74, 54, 151, 120, 307, 312, 199, 408, 356, 424, 912, 1032, 1217, 840, 1872, 423, 1608, 2518, 1588, 1920, 1230, 2112, 3713, 1560, 5208, 2832, 3952, 2872, 3192, 3288, 3432, 8400, 5738, 4080, 4272, 4512, 6288, 8280, 8520, 5232, 5352, 3672, 8892
Offset: 1

Views

Author

Klaus Brockhaus, Sep 27 2003

Keywords

Comments

A053707(k) for k = 1 is a term iff A053707(k) >= A053707(k+1); A053707(k) for k > 1 is a term iff A053707(k-1) < A053707(k) and A053707(k) >= A053707(k+1).
A088366 gives the corresponding indices. Local minima of A053707 are in A088363.

Examples

			The first six terms of A053707 are 3,4,1,7,9,2, hence A053707(2) = 4 is the first and A053707(5) = 9 is the second local maximum of A053707.
		

Crossrefs

Programs

  • PARI
    {m=1; k=0; for(n=2,250000,if(matsize(factor(n))[1]==1&&factor(n)[1,2]>1,d=n-m; if((k<2||b
    				

A088366 a(n) = index of the n-th local maximum of A053707.

Original entry on oeis.org

2, 5, 8, 11, 15, 18, 20, 25, 27, 29, 31, 36, 38, 42, 45, 49, 51, 54, 58, 62, 64, 67, 69, 71, 74, 76, 79, 81, 84, 89, 92, 95, 97, 99, 104, 106, 111, 113, 117, 122, 126, 130, 133, 135, 137, 140, 143, 145, 147, 149, 151, 154, 157, 159, 162, 167, 170, 172, 175, 179, 181
Offset: 1

Views

Author

Klaus Brockhaus, Sep 27 2003

Keywords

Comments

A053707(a(n)) = A088365(n).

Examples

			The fourth local maximum of A053707 is 40 and occurs at index 11, hence a(4) = 11; A053707(a(4)) = A053707(11) = 40 = A088365(4).
		

Crossrefs

Programs

  • PARI
    {m=1; k=0; for(n=2,500000,if(matsize(factor(n))[1]==1&&factor(n)[1,2]>1,d=n-m; if((k<2||b
    				

A025475 1 and the prime powers p^m where m >= 2, thus excluding the primes.

Original entry on oeis.org

1, 4, 8, 9, 16, 25, 27, 32, 49, 64, 81, 121, 125, 128, 169, 243, 256, 289, 343, 361, 512, 529, 625, 729, 841, 961, 1024, 1331, 1369, 1681, 1849, 2048, 2187, 2197, 2209, 2401, 2809, 3125, 3481, 3721, 4096, 4489, 4913, 5041, 5329, 6241, 6561, 6859, 6889, 7921, 8192
Offset: 1

Views

Author

Keywords

Comments

Also nonprime n such that sigma(n)*phi(n) > (n-1)^2. - Benoit Cloitre, Apr 12 2002
If p is a term of the sequence, then the index n for which a(n) = p is given by n := b(p) := 1 + Sum_{k>=2} PrimePi(p^(1/k)). Here, the sum has floor(log_2(p)) positive terms. For any m > 0, the greatest number n such that a(n) <= m is also given by b(m), thus, b(m) is the number of such prime powers <= m. - Hieronymus Fischer, May 31 2013
That 8 and 9 are the only two consecutive integers in this sequence is known as Catalan's Conjecture and was proved in 2002 by Preda Mihăilescu. - Geoffrey Critzer, Nov 15 2015

Crossrefs

Subsequence of A000961. - Reinhard Zumkeller, Jun 22 2011
Differences give A053707.
Cf. A076048 (number of terms < 10^n).
There are four different sequences which may legitimately be called "prime powers": A000961 (p^k, k >= 0), A246655 (p^k, k >= 1), A246547 (p^k, k >= 2), A025475 (p^k, k=0 and k >= 2). When you refer to "prime powers", be sure to specify which of these you mean. Also A001597 is the sequence of nontrivial powers n^k, n >= 1, k >= 2. - N. J. A. Sloane, Mar 24 2018

Programs

  • Haskell
    a025475 n = a025475_list !! (n-1)
    a025475_list = filter ((== 0) . a010051) a000961_list
    -- Reinhard Zumkeller, Jun 22 2011
    
  • Maple
    isA025475 := proc(n)
        if n < 1 then
            false;
        elif n = 1 then
            true;
        elif isprime(n) then
            false;
        elif nops(numtheory[factorset](n)) = 1 then
            true;
        else
            false;
        end if;
    end proc:
    A025475 := proc(n)
        option remember;
        local a;
        if n = 1 then
            1;
        else
            for a from procname(n-1)+1 do
                if isA025475(a) then
                    return a;
                end if;
            end do:
        end if;
    end proc:
    # R. J. Mathar, Jun 06 2013
    # alternative:
    N:= 10^5: # to get all terms <= N
    Primes:= select(isprime, [2,(2*i+1 $ i = 1 .. floor((sqrt(N)-1)/2))]):
    sort([1,seq(seq(p^i, i=2..floor(log[p](N))),p=Primes)]); # Robert Israel, Jul 27 2015
  • Mathematica
    A025475 = Select[ Range[ 2, 10000 ], ! PrimeQ[ # ] && Mod[ #, # - EulerPhi[ # ] ] == 0 & ]
    A025475 = Sort[ Flatten[ Table[ Prime[n]^i, {n, 1, PrimePi[ Sqrt[10^4]]}, {i, 2, Log[ Prime[n], 10^4]}]]]
    {1}~Join~Select[Range[10^4], And[! PrimeQ@ #, PrimePowerQ@ #] &] (* Michael De Vlieger, Jul 04 2016 *)
    Join[{1},Select[Range[100000],PrimePowerQ[#]&&!PrimeQ[#]&]] (* Harvey P. Dale, Oct 29 2023 *)
  • PARI
    for(n=1,10000,if(sigma(n)*eulerphi(n)*(1-isprime(n))>(n-1)^2,print1(n,",")))
    
  • PARI
    is_A025475(n)={ ispower(n,,&p) && isprime(p) || n==1 }  \\ M. F. Hasler, Sep 25 2011
    
  • PARI
    list(lim)=my(v=List([1]),L=log(lim+.5));forprime(p=2,(lim+.5)^(1/3),for(e=3,L\log(p),listput(v,p^e))); vecsort(concat(Vec(v), apply(n->n^2,primes(primepi(sqrtint(lim\1)))))) \\ Charles R Greathouse IV, Nov 12 2012
    
  • PARI
    list(lim)=my(v=List([1])); for(m=2,logint(lim\=1,2), forprime(p=2,sqrtnint(lim,m), listput(v, p^m))); Set(v) \\ Charles R Greathouse IV, Aug 26 2015
    
  • Python
    from sympy import primerange
    A025475_list, m = [1], 10*2
    m2 = m**2
    for p in primerange(1,m):
        a = p**2
        while a < m2:
            A025475_list.append(a)
            a *= p
    A025475_list = sorted(A025475_list) # Chai Wah Wu, Sep 08 2014
    
  • Python
    from sympy import primepi, integer_nthroot
    def A025475(n):
        if n==1: return 1
        def f(x): return int(n-2+x-sum(primepi(integer_nthroot(x,k)[0]) for k in range(2,x.bit_length())))
        kmin, kmax = 1,2
        while f(kmax) >= kmax:
            kmax <<= 1
        while True:
            kmid = kmax+kmin>>1
            if f(kmid) < kmid:
                kmax = kmid
            else:
                kmin = kmid
            if kmax-kmin <= 1:
                break
        return kmax # Chai Wah Wu, Aug 13 2024

Formula

The number of terms <= N is O(sqrt(N)*log N). [See Weisstein link] - N. J. A. Sloane, May 27 2022
A005171(a(n))*A010055(a(n)) = 1. - Reinhard Zumkeller, Nov 01 2009
A192280(a(n)) = 0 for n > 1. - Reinhard Zumkeller, Aug 26 2011
A014963(a(n)) - A089026(a(n)) = A014963(a(n)) - 1. - Eric Desbiaux, May 18 2013
From Hieronymus Fischer, May 31 2013: (Start)
The greatest number n such that a(n) <= m is given by 1 + Sum_{k>=2} A000720(floor(m^(1/k))).
Example 1: m = 10^10 ==> n = 10085;
Example 2: m = 10^11 ==> n = 28157;
Example 3: m = 10^12 ==> n = 80071;
Example 4: m = 10^15 ==> n = 1962690. (End)
Sum_{n>=2} 1/a(n) = Sum_{p prime} 1/(p*(p-1)) = A136141. - Amiram Eldar, Oct 11 2020
From Amiram Eldar, Jan 28 2021: (Start)
Product_{n>=2} (1 + 1/a(n)) = Product_{k>=2} zeta(k)/zeta(2*k) = 2.0729553047...
Product_{n>=2} (1 - 1/a(n)) = A068982. (End)

Extensions

Edited by Daniel Forgues, Aug 18 2009

A053289 First differences of consecutive perfect powers (A001597).

Original entry on oeis.org

3, 4, 1, 7, 9, 2, 5, 4, 13, 15, 17, 19, 21, 4, 3, 16, 25, 27, 20, 9, 18, 13, 33, 35, 19, 18, 39, 41, 43, 28, 17, 47, 49, 51, 53, 55, 57, 59, 61, 39, 24, 65, 67, 69, 71, 35, 38, 75, 77, 79, 81, 47, 36, 85, 87, 89, 23, 68, 71, 10, 12, 95, 97, 99, 101, 103, 40, 65, 107, 109, 100
Offset: 1

Views

Author

Labos Elemer, Mar 03 2000

Keywords

Comments

Michel Waldschmidt writes: Conjecture 1.3 (Pillai). Let k be a positive integer. The equation x^p - y^q = k where the unknowns x, y, p and q take integer values, all >= 2, has only finitely many solutions (x,y,p,q). This means that in the increasing sequence of perfect powers [A001597] the difference between two consecutive terms [the present sequence] tends to infinity. It is not even known whether for, say, k=2, Pillai's equation has only finitely many solutions. A related open question is whether the number 6 occurs as a difference between two perfect powers. See Sierpiński [1970], problem 238a, p. 116. - Jonathan Vos Post, Feb 18 2008
Are there are any adjacent equal terms? - Gus Wiseman, Oct 08 2024

Examples

			Consecutive perfect powers are A001597(14) = 121, A001597(13) = 100, so a(13) = 121 - 100 = 21.
		

References

  • Wacław Sierpiński, 250 problems in elementary number theory, Modern Analytic and Computational Methods in Science and Mathematics, No. 26, American Elsevier, Warsaw, 1970, pp. 21, 115-116.
  • S. S. Pillai, On the equation 2^x - 3^y = 2^X - 3^Y, Bull, Calcutta Math. Soc. 37 (1945) 15-20.

Crossrefs

For non-perfect-powers (A007916) we have A375706.
The union is A023055.
For prime-powers (A000961 or A246655) we have A057820.
Sorted positions of first appearances are A376268, complement A376519.
For second differences we have A376559.
Ascending and descending points are A376560 and A376561.
A001597 lists perfect-powers.
A112344 counts integer partitions into perfect-powers, factorizations A294068.
A333254 gives run-lengths of differences between consecutive primes.

Programs

  • Mathematica
    Differences@ Select[Range@ 3200, # == 1 || GCD @@ FactorInteger[#][[All, 2]] > 1 &] (* Michael De Vlieger, Jun 30 2016, after Ant King at A001597 *)
  • Python
    from sympy import mobius, integer_nthroot
    def A053289(n):
        if n==1: return 3
        def f(x): return int(n-2+x+sum(mobius(k)*(integer_nthroot(x,k)[0]-1) for k in range(2,x.bit_length())))
        kmin, kmax = 1,2
        while f(kmax)+1 >= kmax:
            kmax <<= 1
        rmin, rmax = 1, kmax
        while True:
            kmid = kmax+kmin>>1
            if f(kmid)+1 < kmid:
                kmax = kmid
            else:
                kmin = kmid
            if kmax-kmin <= 1:
                break
        while True:
            rmid = rmax+rmin>>1
            if f(rmid) < rmid:
                rmax = rmid
            else:
                rmin = rmid
            if rmax-rmin <= 1:
                break
        return kmax-rmax # Chai Wah Wu, Aug 13 2024

Formula

a(n) = A001597(n+1) - A001597(n). - Jonathan Vos Post, Feb 18 2008
From Amiram Eldar, Jun 30 2023: (Start)
Formulas from Jakimczuk (2016):
Lim sup_{n->oo} a(n)/(2*n) = 1.
Lim inf_{n->oo} a(n)/(2*n)^(2/3 + eps) = 0. (End)
Can be obtained by inserting 0 between 3 and 6 in A375702 and then adding 1 to all terms. In particular, for n > 2, a(n+1) - 1 = A375702(n). - Gus Wiseman, Sep 14 2024

A065514 Largest power of a prime < prime(n).

Original entry on oeis.org

1, 2, 4, 5, 9, 11, 16, 17, 19, 27, 29, 32, 37, 41, 43, 49, 53, 59, 64, 67, 71, 73, 81, 83, 89, 97, 101, 103, 107, 109, 125, 128, 131, 137, 139, 149, 151, 157, 163, 169, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 243, 256, 257, 263, 269, 271
Offset: 1

Views

Author

Reinhard Zumkeller, Nov 27 2001

Keywords

Crossrefs

Starting with n instead of prime(n) gives A031218 (A377282, A377782).
The squarefree version is A112925 (A070321, A378038).
The opposite squarefree version is A112926 (A378037, restriction of A067535).
Difference from prime(n) is A377289 (restriction of A276781, opposite A377281).
First differences are A377781.
The nonsquarefree version is A378032 (A377783 (restriction of A378033), A378034, A378040).
The perfect power version is A378035.
A000015 gives the least prime power >= n, differences A377780.
A000040 lists the primes, differences A001223.
A000961 and A246655 list the prime powers, differences A057820.
A024619 and A361102 list the non prime powers, differences A375708 and A375735.
A345531 gives the least prime power > prime(n), differences A377703.
Prime powers between primes: A053607, A080101, A304521, A366833, A377057, A377286.

Programs

  • Mathematica
    lpp[n_]:=Module[{k=n-1},While[!PrimePowerQ[k],k--];k]; Join[{1},Table[ lpp[ n],{n,Prime[Range[2,60]]}]] (* Harvey P. Dale, Nov 24 2018 *)
  • Python
    from sympy import factorint, prime
    def A065514(n): return next(filter(lambda m:len(factorint(m))<=1, range(prime(n)-1,0,-1))) # Chai Wah Wu, Oct 25 2024

Extensions

Name edited (1 is technically not a prime power even though it is a power of a prime) by Gus Wiseman, Dec 03 2024.

A377051 Array read by antidiagonals downward where A(n,k) is the n-th term of the k-th differences of the powers of primes.

Original entry on oeis.org

1, 2, 1, 3, 1, 0, 4, 1, 0, 0, 5, 1, 0, 0, 0, 7, 2, 1, 1, 1, 1, 8, 1, -1, -2, -3, -4, -5, 9, 1, 0, 1, 3, 6, 10, 15, 11, 2, 1, 1, 0, -3, -9, -19, -34, 13, 2, 0, -1, -2, -2, 1, 10, 29, 63, 16, 3, 1, 1, 2, 4, 6, 5, -5, -34, -97, 17, 1, -2, -3, -4, -6, -10, -16, -21, -16, 18, 115
Offset: 0

Views

Author

Gus Wiseman, Oct 20 2024

Keywords

Comments

Row k of the array is the k-th differences of A000961.

Examples

			Array form:
        n=1:  n=2:  n=3:  n=4:  n=5:  n=6:  n=7:  n=8:  n=9:
  ----------------------------------------------------------
  k=0:   1     2     3     4     5     7     8     9    11
  k=1:   1     1     1     1     2     1     1     2     2
  k=2:   0     0     0     1    -1     0     1     0     1
  k=3:   0     0     1    -2     1     1    -1     1    -3
  k=4:   0     1    -3     3     0    -2     2    -4     6
  k=5:   1    -4     6    -3    -2     4    -6    10    -8
  k=6:  -5    10    -9     1     6   -10    16   -18     5
  k=7:  15   -19    10     5   -16    26   -34    23     9
  k=8: -34    29    -5   -21    42   -60    57   -14   -42
  k=9:  63   -34   -16    63  -102   117   -71   -28   104
Triangle form:
    1
    2    1
    3    1    0
    4    1    0    0
    5    1    0    0    0
    7    2    1    1    1    1
    8    1   -1   -2   -3   -4   -5
    9    1    0    1    3    6   10   15
   11    2    1    1    0   -3   -9  -19  -34
   13    2    0   -1   -2   -2    1   10   29   63
   16    3    1    1    2    4    6    5   -5  -34  -97
		

Crossrefs

Row k=0 is A000961, exclusive A246655.
Row k=1 is A057820.
Row k=2 is A376596.
The version for primes is A095195, noncomposites A376682, composites A377033.
A version for partitions is A175804, cf. A053445, A281425, A320590.
For squarefree numbers we have A377038, nonsquarefree A377046.
Triangle row-sums are A377052, absolute version A377053.
Column n = 1 is A377054, for primes A007442 or A030016.
First position of 0 in each row is A377055.
A000040 lists the primes, differences A001223, seconds A036263.
A023893 and A023894 count integer partitions into prime-powers, factorizations A000688.

Programs

  • Mathematica
    nn=12;
    t=Table[Take[Differences[NestList[NestWhile[#+1&, #+1,!PrimePowerQ[#]&]&,1,2*nn],k],nn],{k,0,nn}]
    Table[t[[j,i-j+1]],{i,nn},{j,i}]

Formula

A(i,j) = Sum_{k=0..j} (-1)^(j-k)*binomial(j,k)*A000961(i+k).

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.

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).
Showing 1-10 of 51 results. Next