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

A053707 First differences of A025475, powers of a prime but not prime.

Original entry on oeis.org

3, 4, 1, 7, 9, 2, 5, 17, 15, 17, 40, 4, 3, 41, 74, 13, 33, 54, 18, 151, 17, 96, 104, 112, 120, 63, 307, 38, 312, 168, 199, 139, 10, 12, 192, 408, 316, 356, 240, 375, 393, 424, 128, 288, 912, 320, 298, 30, 1032, 271, 1217, 792, 408, 840, 432, 286, 602, 1872, 984, 504
Offset: 1

Views

Author

Labos Elemer, Feb 14 2000

Keywords

Comments

In the graph of this sequence, the lowest curve corresponds to differences of squares of twin primes; the next-lowest curve is for squares of adjacent primes differing by 4, etc. - T. D. Noe, Aug 03 2007

Examples

			2^0 = 1 is the first number that meets the definition of A025475, the next one is 2^2 = 4, hence a(1) = 4 - 1 = 3.
a(3) = A025475(4) - A025475(3) = 9 - 8 = 1; a(11) = A025475(12) - A025475(11) = 121 - 81 = 40.
		

Crossrefs

Cf. A025475.

Programs

  • Mathematica
    Differences@ Join[{1}, Select[Range@ 16200, And[! PrimeQ@ #, PrimePowerQ@ #] &]] (* Michael De Vlieger, Jul 04 2016 *)
  • PARI
    {k=1; for(n=2,16300,if(matsize(factor(n))[1]==1&&factor(n)[1,2]>1,d=n-k; print1(d,","); k=n))} \\ Klaus Brockhaus, Sep 25 2003
    
  • Python
    from sympy import primepi, integer_nthroot
    def A053707(n):
        if n==1: return 3
        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)+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) = A025475(n+1) - A025475(n).

Extensions

Edited by Klaus Brockhaus, Sep 25 2003

A195942 Zeroless prime powers (excluding primes): Intersection of A025475 and A052382.

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, 1331, 1369, 1681, 1849, 2187, 2197, 3125, 3481, 3721, 4489, 4913, 5329, 6241, 6561, 6859, 6889, 7921, 8192
Offset: 1

Views

Author

M. F. Hasler, Sep 25 2011

Keywords

Crossrefs

Programs

  • Haskell
    a195942 n = a195942_list !! (n-1)
    a195942_list = filter (\x -> a010051 x == 0 && a010055 x == 1) a052382_list
    -- Reinhard Zumkeller, Sep 27 2011
  • Mathematica
    mx = 10^10; t = {1}; p = 2; While[pw = 2; While[n = p^pw; n <= mx, If[Union[IntegerDigits[n]][[1]] > 0, AppendTo[t, n]]; pw++]; pw > 2, p = NextPrime[p]]; t = Sort[t] (* T. D. Noe, Sep 27 2011 *)
  • PARI
    for( n=1,9999, is_A025475(n) && is_A052382(n) && print1(n","))
    

Formula

A195942 = A025475 intersect A052382.
A010055(a(n)) * (1 - A010051(a(n))) * A168046(a(n)) = 1. - Reinhard Zumkeller, Sep 27 2011

A053706 Primes p such that between p and the next prime, 2 prime powers (A025475) occur.

Original entry on oeis.org

7, 23, 113, 2179, 32749
Offset: 1

Views

Author

Labos Elemer, Feb 14 2000

Keywords

Comments

No other terms < 4290000000. - Jud McCranie, Jun 20 2000
There are no other terms < 2^63. - Donovan Johnson, Mar 11 2013

Examples

			Between 7 and 11 the 2 prime powers are 8 and 9, between 23 and 29 the 2 prime powers are 25 and 27, between 113 and 127 the 2 prime powers are 121 and 125, while between 32749 and 32771 the 2 prime powers are 32761 = 181^2 and 32768 = 2^15.
		

Crossrefs

Programs

  • Mathematica
    nn = 2^20; Prime /@ Keys@ Select[PositionIndex[PrimePi /@ Union@ Flatten@ Table[Array[p^# &, Floor@ Log[p, nn] - 1, 2], {p, Prime@ Range@ PrimePi@ Sqrt@ nn}]], Length[#] > 1 &] (* Michael De Vlieger, Mar 21 2024 *)
  • PARI
    isok(p) = isprime(p) && (q=nextprime(p+1)) && (v=vector(q-p, x, p+x)) && (#select(x->(isprimepower(x) && !isprime(x)), v) == 2);
    lista(nn) = forprime(p=2, nn, if (isok(p), print1(p, ", "))); \\ Michel Marcus, Jul 15 2017

Extensions

Corrected by James Sellers, Feb 22 2000

A025476 Prime root of n-th nontrivial prime power (A025475, A246547).

Original entry on oeis.org

2, 2, 3, 2, 5, 3, 2, 7, 2, 3, 11, 5, 2, 13, 3, 2, 17, 7, 19, 2, 23, 5, 3, 29, 31, 2, 11, 37, 41, 43, 2, 3, 13, 47, 7, 53, 5, 59, 61, 2, 67, 17, 71, 73, 79, 3, 19, 83, 89, 2, 97, 101, 103, 107, 109, 23, 113, 11, 5, 127, 2, 7, 131, 137, 139, 3, 149, 151, 29, 157, 163, 167, 13, 31, 173, 179
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Maple
    cvm := proc(n, level) local f,opf; if n < 2 then RETURN() fi;
    f := ifactors(n); opf := op(1,op(2,f)); if nops(op(2,f)) > 1 or
    op(2,opf) <= level then RETURN() fi; op(1,opf) end:
    A025476_list := n -> seq(cvm(i,1),i=1..n); # n is search limit
    A025476_list(30000);  # Peter Luschny, Sep 21 2011
    # Alternative:
    isA246547 := n -> n > 1 and not isprime(n) and type(n, 'primepower'):
    seq(ifactors(p)[2][1][1], p in select(isA246547, [$1..30000])); # Peter Luschny, Jul 15 2023
  • Mathematica
    Transpose[ Flatten[ FactorInteger[ Select[ Range[2, 30000], !PrimeQ[ # ] && Mod[ #, # - EulerPhi[ # ]] == 0 &]], 1]][[1]] (* Robert G. Wilson v *)
  • PARI
    forcomposite(n=4,10^5,if( ispower(n, , &p) && isprime(p), print1(p,", "))) \\ Joerg Arndt, Sep 11 2021
    
  • Python
    from sympy import primepi, integer_nthroot, primefactors
    def A025476(n):
        def f(x): return int(n-1+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 primefactors(kmax)[0] # Chai Wah Wu, Aug 15 2024

A061670 Distance to nearest prime power p^k, k=0 and k >= 2 (A025475).

Original entry on oeis.org

0, 1, 1, 0, 1, 2, 1, 0, 0, 1, 2, 3, 3, 2, 1, 0, 1, 2, 3, 4, 4, 3, 2, 1, 0, 1, 0, 1, 2, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
Offset: 1

Views

Author

Michel ten Voorde, Jun 16 2001

Keywords

Examples

			a(12)=3 because 9=3^2 is the nearest power to 12 (12-9=3).
		

Crossrefs

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).

Programs

  • Maple
    N:= 1000: # to get a(1)..a(M) where M is the greatest prime power <= N.
    Primes:= select(isprime, [2,seq(i,i=3..floor(sqrt(N)))]):
    Pows:= sort(convert({1,seq(seq(p^e,e=2..floor(log[p](N))),p=Primes)},list)):
    nP:= nops(Pows):
    M:= Pows[nP]:
    V:= Vector(M):
    V[2]:= 1:
    for i from 2 to nP-1 do
      for x from ceil((Pows[i]+Pows[i-1])/2) to floor((Pows[i]+Pows[i+1])/2) do
        V[x]:= abs(x - Pows[i])
    od od:
    for x from ceil((M+Pows[nP-1])/2) to M do V[x]:= M - x od:
    convert(V,list); # Robert Israel, Mar 23 2018
  • PARI
    isA025475(n) = {isprimepower(n) && !isprime(n) || n==1}
    a(n) = {my(k=0); while(!isA025475(n+k) && !isA025475(n-k), k++); k; } \\ Altug Alkan, Mar 23 2018

Extensions

Definition corrected, and more terms from Robert Israel, Mar 23 2018

A025477 a(n) = exponent of the n-th nontrivial prime power A025475(n).

Original entry on oeis.org

0, 2, 3, 2, 4, 2, 3, 5, 2, 6, 4, 2, 3, 7, 2, 5, 8, 2, 3, 2, 9, 2, 4, 6, 2, 2, 10, 3, 2, 2, 2, 11, 7, 3, 2, 4, 2, 5, 2, 2, 12, 2, 3, 2, 2, 2, 8, 3, 2, 2, 13, 2, 2, 2, 2, 2, 3, 2, 4, 6, 2, 14, 5, 2, 2, 2, 9, 2, 2, 3, 2, 2, 2, 4, 3, 2, 2, 2, 15, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 10, 2, 16, 2, 3, 2, 2, 2, 2, 7, 2, 3, 2
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    With[{nn = 2^20}, {0}~Join~Map[FactorInteger[#][[1, -1]] &, Select[Union@ Flatten@ Table[a^2*b^3, {b, nn^(1/3)}, {a, Sqrt[nn/b^3]}], PrimePowerQ] ] ] (* Michael De Vlieger, Oct 23 2023 *)

Formula

a(n) = A051903(A025475(n)) = A001222(A025475(n)). - Reinhard Zumkeller, Mar 10 2003

Extensions

Edited by N. J. A. Sloane, Jan 17 2009 at the suggestion of R. J. Mathar
Name edited by Michael De Vlieger, Oct 23 2023

A072037 Palindromic powers (with positive exponents) of a prime but not a prime (A025475).

Original entry on oeis.org

4, 8, 9, 121, 343, 1331, 10201, 14641, 94249, 1030301, 104060401, 900075181570009, 10022212521222001, 12124434743442121, 12323244744232321, 12341234943214321, 1022321210249420121232201, 1210024420147410244200121, 1210222232227222322220121
Offset: 1

Views

Author

Labos Elemer, Jun 07 2002

Keywords

Examples

			E.g. 94249=307*307
		

Crossrefs

Programs

  • Mathematica
    a = {}; Do[pp = Prime[n]^i; d = IntegerDigits[pp]; If[d == Reverse[d], a = Append[a, pp]], {n, 1, PrimePi[ Sqrt[10^21]]}, {i, 2, Floor[ Log[ Prime[n], 10^21]]}]; Sort[a] (Robert G. Wilson v)
  • PARI
    {a=10^15; v=[]; m=sqrt(a); forprime(p=2,m,q=p; while((q=q*p)0,d=divrem(n,10); n=d[1]; rev=10*rev+d[2]); if(q==rev,v=concat(v,q)))); v=vecsort(v); for(j=1,matsize(v)[2],print1(v[j],","))}

Extensions

Two more term from Klaus Brockhaus, Jun 07 2002
Four more terms from Robert G. Wilson v, Oct 31 2002
Added a(17)-a(19), clarified definition, Donovan Johnson, Sep 01 2012

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

A113495 Lexicographically earliest subsequence of the perfect powers in A025475 such that first differences are an increasing sequence of primes.

Original entry on oeis.org

1, 4, 9, 16, 27, 64, 125, 256, 2187, 16384, 161051, 23945242826029513411849172299223580994042798784118784, 23945249190331908165492143678605499565319109933299901
Offset: 1

Views

Author

Giovanni Teofilatto, Jan 10 2006

Keywords

Comments

Next terms are a(14) = 2^206, a(15) = 590295810335799160457^3, a(16) = 2^754. - Max Alekseyev, May 21 2011
Note: if the definition is changed to refer to the perfect powers in A001597, the sequence becomes A137354. - R. J. Mathar, Mar 07 2008

Examples

			a(2) = 4 because 1 + 3 = 4;
a(3) = 9 because 1 + 3 + 5 = 9;
a(4) = 16 because 1 + 3 + 5 + 7 = 16;
a(5) = 27 because 1 + 3 + 5 + 7 + 11 = 27;
a(6) = 64 because 1 + 3 + 5 + 7 + 11 + 37 = 64;
a(7) = 125 because 1 + 3 + 5 + 7 + 11 + 37 + 61 = 125;
a(8) = 256 because 1 + 3 + 5 + 7 + 11 + 37 + 61 + 131 = 256.
		

Crossrefs

Cf. A113759.

Extensions

3 more terms from R. J. Mathar, Mar 07 2008
a(12) from Donovan Johnson, Aug 09 2010
a(13)-a(16) from Max Alekseyev, May 21 2011

A239520 Prime powers (A025475) such that the distance to the nearest prime power is a triangular number (A000217).

Original entry on oeis.org

1, 4, 8, 9, 49, 64, 125, 128, 2187, 2197, 654481, 657721, 1442401, 1442897, 1708249, 7252249, 7946761, 13053769, 13082689, 21557449, 39677401, 39702601, 86136961, 86174089, 106729561, 106770889, 184063489, 253987969, 302516449, 626550961, 626651089, 844425481
Offset: 1

Views

Author

Alex Ratushnyak, Mar 20 2014

Keywords

Crossrefs

Showing 1-10 of 214 results. Next