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 11-20 of 124 results. Next

A320700 Odd numbers whose product of prime indices is a nonprime prime power (A246547).

Original entry on oeis.org

7, 9, 19, 21, 23, 25, 27, 49, 53, 57, 63, 81, 97, 103, 115, 121, 125, 131, 133, 147, 159, 171, 189, 227, 243, 289, 311, 343, 361, 371, 393, 399, 419, 441, 477, 513, 515, 529, 567, 575, 625, 661, 691, 719, 729, 917, 931, 933, 961, 1007, 1009, 1029, 1067, 1083
Offset: 1

Views

Author

Gus Wiseman, Oct 19 2018

Keywords

Examples

			The sequence of all integer partitions whose Heinz numbers belong to the sequence begins: (4), (2,2), (8), (4,2), (9), (3,3), (2,2,2), (4,4), (16), (8,2), (4,2,2), (2,2,2,2), (25), (27), (9,3), (5,5), (3,3,3), (32), (8,4), (4,4,2), (16,2), (8,2,2), (4,2,2,2), (49), (2,2,2,2,2)
		

Crossrefs

Programs

  • Mathematica
    Select[Range[1000],With[{x=Times@@Cases[FactorInteger[#],{p_,k_}:>PrimePi[p]^k]},OddQ[#]&&!PrimeQ[x]&&PrimePowerQ[x]]&]

A060847 Difference between a nontrivial prime power (A246547) and the previous prime.

Original entry on oeis.org

1, 1, 2, 3, 2, 4, 1, 2, 3, 2, 8, 12, 1, 2, 2, 5, 6, 6, 2, 3, 6, 6, 2, 2, 8, 3, 4, 2, 12, 2, 9, 8, 18, 2, 2, 6, 4, 12, 2, 3, 6, 4, 2, 6, 12, 8, 2, 6, 2, 1, 6, 8, 2, 2, 14, 4, 6, 2, 6, 2, 3, 20, 2, 12, 2, 2, 8, 14, 10, 18, 8, 6, 2, 2, 2, 12, 12, 19, 2, 6, 6, 20, 2, 2, 2, 8, 8, 2, 2, 8, 20, 12, 15, 2, 4
Offset: 1

Views

Author

Labos Elemer, May 03 2001

Keywords

Comments

a(n)=1 only for some powers of 2.

Examples

			78125=5^7 follows 78121, the difference is 4.
		

Crossrefs

Programs

  • Maple
    N:= 10^5: # to consider prime powers <= N
    P:= select(isprime,[2,seq(i,i=3..floor(sqrt(N)),2)]):
    PP:= sort([seq(seq(p^k,k=2..ilog[p](N)),p=P)]):
    map(t -> t - prevprime(t), PP); # Robert Israel, Nov 13 2024
  • Python
    from sympy import primepi, integer_nthroot, prevprime
    def A060847(n):
        def f(x): return int(n+x-sum(primepi(integer_nthroot(x,k)[0]) for k in range(2,x.bit_length())))
        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
        return (a:=bisection(f,n,n))-prevprime(a) # Chai Wah Wu, Sep 13 2024

Formula

a(n) = A246547(n)-prevprime(A246547(n)) = A246547(n)-A049711(A246547(n)).

A282633 Numbers n such that n^2 + 1 is the sum of two proper prime powers (A246547) in more than one way.

Original entry on oeis.org

47, 73, 83, 133, 157, 173, 187, 191, 203, 217, 317, 319, 353, 437, 463, 467, 487, 499, 557, 577, 583, 593, 599, 613, 623, 697, 703, 727, 733, 767, 829, 857, 863, 871, 931, 983, 1013, 1027, 1033, 1067, 1087, 1097, 1123, 1139, 1177, 1267, 1279, 1321, 1327, 1333, 1363, 1403, 1409, 1433, 1453, 1477, 1487, 1493, 1507, 1517, 1543, 1567, 1603, 1607, 1613
Offset: 1

Views

Author

Robert Israel and Altug Alkan, Feb 19 2017

Keywords

Examples

			83 is a term because 83^2 + 1 = 7^4 + 67^2 = 43^2 + 71^2.
		

Crossrefs

Programs

  • Maple
    N:= 10^8: # to get all terms <= sqrt(N-1).
    PP:= sort([seq(seq(p^k, k=2..floor(log[p](N))), p = select(isprime, [2, seq(i, i=3..floor(sqrt(N)), 2)]))]):
    npp:= nops(PP):
    res:= {}: R:= 'R':
    for i from 2 to npp do
       for j from 1 to i-1 do
         q:= PP[i]+PP[j];
         if q > N then break fi;
          if issqr(q-1) then
           if assigned(R[q]) then res:= res union {q}
            else R[q]:= 1
          fi fi
    od od:
    sort(convert(map(t -> sqrt(t-1), res),list));

A287299 Number of ways of writing n as a sum of a proper prime power (A246547) and a nonprime squarefree number (A000469).

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 2, 0, 0, 0, 2, 1, 0, 1, 2, 2, 0, 0, 2, 2, 1, 1, 3, 0, 1, 1, 4, 3, 0, 2, 2, 2, 0, 3, 4, 3, 1, 2, 6, 3, 1, 0, 5, 4, 2, 2, 4, 3, 0, 2, 3, 5, 0, 1, 3, 4, 3, 2, 4, 3, 3, 4, 5, 4, 0, 2, 5, 5, 0, 4, 6, 2, 1, 1, 7, 3, 1, 2, 7, 4, 2, 4, 5, 5, 1, 3, 6, 5, 1, 3, 6, 6, 3, 4, 4, 4, 2, 4, 7, 6, 3, 1, 4, 4, 0, 4, 6, 5, 2, 2, 7, 5, 2, 1, 7, 8, 4
Offset: 0

Views

Author

Ilya Gutkovskiy, May 23 2017

Keywords

Comments

Conjecture: a(n) > 0 for all n > 108.

Examples

			a(26) = 3 because we have [25, 1], [22, 4] and [16, 10].
		

Crossrefs

Programs

  • Mathematica
    nmax = 120; CoefficientList[Series[(Sum[Boole[SquareFreeQ[k] && ! PrimeQ[k]] x^k, {k, 1, nmax}]) (Sum[Boole[PrimePowerQ[k] && ! PrimeQ[k]] x^k, {k, 1, nmax}]), {x, 0, nmax}], x]
  • PARI
    x='x+O('x^120); concat([0, 0, 0, 0, 0], Vec(sum(k=1, 120, (issquarefree(k) && !isprime(k))*x^k) * sum(k=1, 120, (isprimepower(k) && !isprime(k))*x^k))) \\ Indranil Ghosh, May 23 2017

Formula

G.f.: (Sum_{k>=1} x^A246547(k))*(Sum_{k>=1} x^A000469(k)).

A290135 Numbers that are the sum of two proper prime powers (A246547).

Original entry on oeis.org

8, 12, 13, 16, 17, 18, 20, 24, 25, 29, 31, 32, 33, 34, 35, 36, 40, 41, 43, 48, 50, 52, 53, 54, 57, 58, 59, 64, 65, 68, 72, 73, 74, 76, 80, 81, 85, 89, 90, 91, 96, 97, 98, 106, 108, 113, 125, 128, 129, 130, 132, 133, 134, 136, 137, 141, 144, 145, 146, 148, 150, 152, 153, 155, 157, 160, 162, 170, 173, 174, 177, 178
Offset: 1

Views

Author

Ilya Gutkovskiy, Jul 20 2017

Keywords

Comments

Is 2213 the largest prime term that can be expressed as the sum of two proper prime powers in more than one way? - Altug Alkan, Jul 22 2017

Examples

			13 is in the sequence because 13 = 2^2 + 3^2.
		

Crossrefs

Programs

  • Maple
    N:= 1000: # to get all terms <= N
    P:= select(isprime, [$2..floor(sqrt(N))]):
    PP:= {seq(seq(p^j, j=2..floor(log[p](N))),p=P)}:
    A:= select(`<=`,{seq(seq(PP[i]+PP[j],j=1..i),i=1..nops(PP))},N):
    sort(convert(A,list)); # Robert Israel, Jul 21 2017
  • Mathematica
    nmax = 180; f[x_] := Sum[Boole[PrimePowerQ[k] && PrimeOmega[k] > 1] x^k, {k, 1, nmax}]^2; Exponent[#, x] & /@ List @@ Normal[Series[f[x], {x, 0, nmax}]]

Formula

Exponents in expansion of (Sum_{k>=1} x^A246547(k))^2.

A343123 Primes p such that the sum of A001414(k) for k strictly between p and the following prime is a proper prime power (a term of A246547).

Original entry on oeis.org

3, 13, 17, 19, 239, 269, 457, 751, 1091, 1319, 1871, 2129, 2141, 2341, 2549, 2683, 2969, 3167, 3359, 3671, 3821, 4091, 4799, 5437, 5843, 6299, 6551, 6779, 7559, 8387, 8999, 9239, 9419, 10529, 11057, 11717, 11777, 12071, 13309, 13901, 17027, 17203, 18047, 18311, 18521, 21139, 23831, 26249, 26861
Offset: 1

Views

Author

J. M. Bergot and Robert Israel, Apr 05 2021

Keywords

Comments

Primes prime(k) such that Sum_{prime(k) < j < prime(k+1)} A001414(j) is in A246547.

Examples

			a(4) = 19 is a term because 19 and 23 are consecutive primes with Sum_{19 < j < 23} A001414(j) = 9+10+13 = 32 = 2^5.
		

Crossrefs

Programs

  • Maple
    spf:= proc(n) local t; add(t[1]*t[2],t=ifactors(n)[2]) end proc:
    R:= NULL: count:= 0: p:= 2:
    while count < 100 do
      q:= p; p:= nextprime(p);
      L:= ifactors(add(spf(i),i=q+1..p-1))[2];
      if nops(L) = 1 and L[1][2]>1 then
        count:= count+1; R:= R, q;
      fi
    od:
    R;

A282533 Primes that are the sum of two proper prime powers (A246547) in more than one way.

Original entry on oeis.org

41, 89, 113, 137, 593, 857, 2213
Offset: 1

Views

Author

Altug Alkan, Feb 17 2017

Keywords

Comments

Primes of the form 2^k + p^e in more than one way where p is an odd prime (e > 1, k > 1).
Prime terms in A225103.
29 = 2^4 + 5^2 = 2 + 3^3 is a border case not included in this sequence - Olivier Gérard, Feb 25 2019
a(8) > 10^8 if it exists. - Robert Israel, Feb 17 2017
a(8) > 10^18 if it exists. - Charles R Greathouse IV, Feb 19 2017

Examples

			41 = 2^4 + 5^2 = 2^5 + 3^2.
89 = 2^3 + 3^4 = 2^6 + 5^2.
113 = 2^5 + 3^4 = 2^6 + 7^2.
137 = 2^7 + 3^2 = 2^4 + 11^2.
593 = 2^9 + 3^4 = 2^6 + 23^2.
857 = 2^7 + 3^6 = 2^4 + 29^2.
2213 = 2^4 + 13^3 = 2^2 + 47^2.
		

Crossrefs

Cf. A115231 (prime numbers which cannot be written as 2^a + p^b, b>=0)

Programs

  • MATLAB
    N = 10^8; % to get all terms <= N
    C = sparse(1,N);
    for p = primes(sqrt(N))
      C(p .^ [2:floor(log(N)/log(p))]) = 1;
    end
    R = zeros(1,N);
    for k = 2: floor(log2(N))
      R((2^k+1):N) = R((2^k+1):N) + C(1:(N-2^k));
    end
    P = primes(N);
    P(R(P) > 1.5) % Robert Israel, Feb 17 2017
    
  • Maple
    N:= 10^6: # to get all terms <= N
    B:= Vector(N):
    C:= Vector(N):
    for k from 2 to ilog2(N) do B[2^k]:= 1 od:
    p:= 2:
    do
      p:= nextprime(p);
      if p^2 > N then break fi;
      for k from 2 to floor(log[p](N)) do C[p^k]:= 1 od:
    od:
    R:= SignalProcessing:-Convolution(B,C):
    select(t -> isprime(t) and R[t-1] > 1.5, [seq(i,i=3..N,2)]); # Robert Israel, Feb 17 2017
  • Mathematica
    Select[Prime@ Range[10^3], Function[n, Count[Transpose@{n - #, #}, w_ /; Times @@ Boole@ Map[And[PrimePowerQ@ #, ! PrimeQ@ #] &, w] > 0] >= 2 &@ Range[4, Floor[n/2]]]] (* or *)
    With[{n = 10^8}, Keys@ Select[#, Length@ # > 1 &] &@ GroupBy[#, First] &@ SortBy[Transpose@ {Map[Total, #], #}, First] &@ Select[Union@ Map[Sort, Tuples[#, 2]], PrimeQ@ Total@ # &] &@ Flatten@ Map[#^Range[2, Log[#, Prime@ n]] &, Array[Prime@ # &, Floor@ Sqrt@ n]]] (* Michael De Vlieger, Feb 19 2017, latter program Version 10 *)
  • PARI
    is(n) = if(!ispseudoprime(n), return(0), my(x=n-1, y=1, i=0); while(y < x, if(isprimepower(x) > 1 && isprimepower(y) > 1, if(i==0, i++, return(1))); y++; x--)); 0 \\ Felix Fröhlich, Feb 18 2017
    
  • PARI
    has(p)=my(t,q); p>40 && sum(k=2,logint(p-9,2), t=2^k; sum(e=2,logint(p-t,3), ispower(p-t,e,&q) && isprime(q)))>1
    list(lim)=my(v=List(),t,q); lim\=1; if(lim<9,lim=9); for(k=2,logint(lim-9,2), t=2^k; for(e=2,logint(lim-t,3), forprime(p=3,sqrtnint(lim-t,e), q=t+p^e; if(isprime(q) && has(q), listput(v,q))))); Set(v) \\ Charles R Greathouse IV, Feb 18 2017

A282578 Least k such that k^n is the sum of two distinct proper prime powers (A246547), or 0 if no such k exists.

Original entry on oeis.org

12, 5, 5, 3, 62
Offset: 1

Views

Author

Altug Alkan, Feb 20 2017

Keywords

Comments

Corresponding values of k^n are 12, 25, 125, 81, 916132832, ...

Examples

			a(1) = 12 because 12 = 2^2 + 2^3.
a(2) = 5 because 5^2 = 2^4 + 3^2.
a(3) = 5 because 5^3 = 2^2 + 11^2.
a(4) = 3 because 3^4 = 2^5 + 7^2.
a(5) = 62 because 62^5 = 31^5 + 31^6.
a(9) = 2 because 2^9 = 7^3 + 13^2.
		

Crossrefs

Programs

  • Python
    from sympy import nextprime, perfect_power
    def ppupto(limit): # distinct proper prime powers <= limit
        p = 2; p2 = pk = p*p; pklist = []
        while p2 <= limit:
            while pk <= limit: pklist.append(pk); pk *= p
            p = nextprime(p); p2 = pk = p*p
        return sorted(pklist)
    def sum_of_pp(n):
        pp = ppupto(n); ppset = set(pp)
        for p in pp:
            if p > n//2: break
            if n - p in ppset and n - p != p: return True
        return False
    def a(n):
        k = 2
        while not sum_of_pp(k**n): k += 1
        return k
    print([a(n) for n in range(1, 6)]) # Michael S. Branicky, Dec 05 2021

Formula

a(p) <= 2 * (2^p - 1) where p is in A000043 since (2^p - 1)^p + (2^p - 1)^(p + 1) = (2 * (2^p - 1))^p.

A282686 Least sum of two proper prime powers (A246547) that is the product of n distinct primes.

Original entry on oeis.org

13, 33, 130, 966, 14322, 81510, 3530730, 117535110, 2211297270, 131031070170, 1295080356570, 163411918786830, 3389900689405230, 414524121952915590, 2951531806477464210, 754260388389042905370
Offset: 1

Views

Author

Altug Alkan, Feb 20 2017

Keywords

Comments

Least value of A225102 that is the product of n distinct primes.
From Jon E. Schoenfield, Mar 18 2017: (Start)
For each n, we can write a(n) = p^j + q^k where p and q are prime and 2 <= j <= k; since a(n) is squarefree, p and q are distinct.
Suppose j and k are both even. Then a(n) cannot have any prime factor f such that f == 3 (mod 4) (see A002145). Thus, a(n) is the product of n distinct terms of {2, 5, 13, 17, 29, 37, 41, ...} = A002313, so a(n) >= Product_{i=1..n} A002313(i) = A185952(n).
In fact, however, a(n) < A185952(n) for n = 4..15, and it seems nearly certain that this holds for all n > 3. In any case, if we search for a(n) by generating products of n distinct primes and, for each such product P, testing whether there exists a solution for P = p^j + q^k, then we need not consider solutions in which both j and k are even unless P >= A185952(n).
Additionally, since the sum of any two cubes that is divisible by 3 is also divisible by 9 (hence nonsquarefree), any P that is divisible by 3 cannot be the sum of two cubes, so the exponents j and k cannot both be divisible by 3. (Every P < 2*5*7*11*...*prime(n+1) = A002110(n+1)/3 is divisible by 3.) Thus, for every P that is divisible by 3 and < A185292(n), we can rule out every ordered pair (j,k) except (2,3) and (3,4) (which could be tested together by computing t = P - r^3 for each prime r < P^(1/3) and, if t is square, checking whether sqrt(t) is a prime or the square of a prime) and those with k >= 5 (which could be tested by checking whether t = P - q^k is a prime power for each prime power q^k that is less than P and has k >= 5). (End)
a(17) <= 63985284333636413237490 = 2 * 3 * 5 * 7 * 11 * 13 * 17 * 19 * 23 * 29 * 37 * 41 * 43 * 59 * 61 * 103 * 409 = 10461281^3 + 250679912393^2. - Jon E. Schoenfield, Mar 31 2017

Examples

			a(1) = 13 = 2^2 + 3^2.
a(2) = 33 = 5^2 + 2^3 = 3 * 11.
a(3) = 130 = 3^2 + 11^2 = 2 * 5 * 13.
a(4) = 966 = 5^3 + 29^2 = 2 * 3 * 7 * 23.
a(5) = 14322 = 17^3 + 97^2 = 2 * 3 * 7 * 11 * 31.
a(6) = 81510 = 29^3 + 239^2 = 2 * 3 * 5 * 11 * 13 * 19.
a(7) = 3530730 = 41^4 + 89^3 = 2 * 3 * 5 * 7 * 17 * 23 * 43.
a(8) = 117535110 = 461^3 + 4423^2 = 2 * 3 * 5 * 7 * 11 * 17 * 41 * 73.
From _Jon E. Schoenfield_, Mar 14 2017: (Start)
a(9) = 2211297270 = 1301^3 + 3037^2 = 2 * 3 * 5 * 7 * 13 * 17 * 29 * 31 * 53.
a(10) = 131031070170 = 1361^3 + 358483^2 = 2 * 3 * 5 * 7 * 11 * 13 * 17 * 43 * 47 * 127. (End)
From _Giovanni Resta_, Mar 14 2017: (Start)
a(11) = 810571^2 + 8609^3,
a(12) = 12694849^2 + 13109^3. (End)
From _Jon E. Schoenfield_, Mar 18 2017: (Start)
a(13) = 24537703^2 + 140741^3.
a(14) = 639414679^2 + 178349^3.
a(15) = 1632727069^2 + 658649^3. (End)
a(16) = 1472015189^2 + 9094049^3. - _Jon E. Schoenfield_, Mar 19 2017
		

Crossrefs

Programs

  • Maple
    N:= 1.2*10^8: # to get all terms <= N
    PP:= {seq(seq(p^k,k=2..floor(log[p](N))), p = select(isprime, [2,seq(i,i=3..floor(sqrt(N)),2)]))}:
    PP:= sort(convert(PP,list)):
    A:= 'A':
    for i from 1 to nops(PP) do
      for j from 1 to i do
         Q:= PP[i]+PP[j];
         if Q > N then break fi;
         F:= ifactors(Q)[2];
         if max(seq(f[2],f=F))>1 then next fi;
         m:= nops(F);
         if not assigned(A[m]) or A[m] > Q then A[m]:= Q fi
    od od:
    seq(A[i],i=1..max(map(op,[indices(A)]))); # Robert Israel, Mar 01 2017
  • Mathematica
    (* first 8 terms *) mx = 1.2*^8; a = 0 Range[8] + mx; p = Sort@ Flatten@ Table[ p^Range[2, Log[p, mx]], {p, Prime@ Range@ PrimePi@ Sqrt@ mx}]; Do[ j=1; While[j <= i && (v = p[[i]] + p[[j]]) < mx, f = FactorInteger@v; If[Max[Last /@ f] == 1, c = Length@f; If[c < 9 && v < a[[c]], a[[c]] = v]]; j++], {i, Length@p}]; a (* Giovanni Resta, Mar 19 2017 *)
  • PARI
    do(lim)=my(v=List(),u=v,t,f); t=1; for(i=1,lim, t*=prime(i); if(t>lim,break); listput(v, oo)); v=Vec(v); for(e=2,logint(lim\=1,2), forprime(p=2,sqrtnint(lim-4,e), listput(u,p^e))); u=Set(u); for(i=1,#u, for(j=1,i, t=u[i]+u[j]; if(t>lim, break); f=factor(t)[,2]; if(vecmax(f)==1 && tif(k==oo,"?",k), v) \\ Charles R Greathouse IV, Mar 19 2017
    
  • PARI
    do(lim)=my(v=List(),u=v,t,f,p2); t=1; for(i=1,lim, t*=prime(i); if(t>lim,break); listput(v, oo)); v=Vec(v); for(e=3,logint(lim\=1,2), forprime(p=2,sqrtnint(lim-4,e), listput(u,p^e))); u=Set(u); for(i=1,#u, for(j=1,i, t=u[i]+u[j]; if(t>lim, break); f=factor(t)[,2]; if(vecmax(f)==1 && tlim, break); f=factor(t)[,2]; if(vecmax(f)==1 && tlim, break); f=factor(t)[,2]; if(vecmax(f)==1 && tif(k==oo,"?",k), v) \\ Charles R Greathouse IV, Mar 19 2017

Extensions

a(7)-a(8) from Giovanni Resta, Feb 21 2017
a(9)-a(10) from Jon E. Schoenfield, Mar 14 2017
a(11)-a(12) from Giovanni Resta, Mar 14 2017
a(13)-a(15) from Jon E. Schoenfield, Mar 18 2017
a(16) from Jon E. Schoenfield, Mar 19 2017

A301296 Smallest distance from n to a prime power (as defined in A246547).

Original entry on oeis.org

3, 2, 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
Offset: 1

Views

Author

N. J. A. Sloane, Mar 24 2018

Keywords

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).
Previous Showing 11-20 of 124 results. Next