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-7 of 7 results.

A225103 Numbers that can be represented as a sum of two distinct nontrivial prime powers in two or more ways.

Original entry on oeis.org

36, 41, 57, 89, 113, 129, 130, 137, 153, 177, 185, 297, 305, 368, 370, 377, 410, 425, 537, 545, 561, 593, 633, 650, 657, 850, 857, 868, 873, 890, 969, 986, 1010, 1130, 1385, 1490, 1690, 1730, 1802, 1865, 1881, 1898, 1970, 2210, 2213, 2217, 2236, 2330, 2337
Offset: 1

Views

Author

Alex Ratushnyak, Apr 28 2013

Keywords

Comments

Indices of terms bigger than 1 in A225099.
Nontrivial prime powers are numbers of the form p^k where p is a prime number and k >= 2. That is, A025475 except the first term A025475(1) = 1.
Only 267 of the terms below 2^34 are odd.

Examples

			36 = 32 + 4 = 27 + 9, so 36 is in the sequence.
41 = 32 + 9 = 25 + 16, so 41 is in the sequence.
		

Crossrefs

Programs

  • Maple
    N:= 10^4: # 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)]))]:
    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 assigned(R[q]) then res:= res union {q}
        else R[q]:= 1
        fi
    od od:
    sort(convert(res,list)); # Robert Israel, Feb 17 2017
  • Mathematica
    nn = 2409; p = Sort[Flatten[Table[Prime[n]^i, {n, PrimePi[Sqrt[nn]]}, {i, 2, Log[Prime[n], nn]}]]]; Transpose[Sort[Select[Tally[Flatten[Table[p[[i]] + p[[j]], {i, Length[p] - 1}, {j, i + 1, Length[p]}]]], #[[1]] <= nn && #[[2]] > 1 &]]][[1]] (* T. D. Noe, Apr 29 2013 *)

A282550 Perfect powers that are the sum of two distinct proper prime powers (A246547).

Original entry on oeis.org

25, 36, 81, 125, 144, 196, 324, 512, 576, 1089, 2304, 2744, 2916, 5041, 9216, 14884, 16641, 26244, 36864, 51984, 147456, 236196, 589824, 941192, 1196836, 2125764, 2359296, 9437184, 19131876, 37748736, 67125249, 150994944, 172186884, 322828856, 603979776
Offset: 1

Views

Author

Altug Alkan, Feb 18 2017

Keywords

Comments

Intersection of A001597 and A225102. - Michel Marcus, Feb 18 2017
Terms t of A001597 such that A225099(t) > 0. - Felix Fröhlich, Feb 18 2017

Examples

			512 = 2^9 is a term because 2^9 = 7^3 + 13^2.
		

Crossrefs

Programs

  • Mathematica
    Select[Union@ Map[Total, Subsets[With[{nn = 10^6}, Complement[ Select[ Range@ nn, PrimePowerQ], Prime[Range[PrimePi@ nn]]]], {2}]], # == 1 ||
    GCD @@ FactorInteger[#][[All, 2]] > 1 &] (* Michael De Vlieger, Feb 18 2017, after Harvey P. Dale at A246547 *)
  • PARI
    is(n) = if(!ispower(n), return(0), my(x=n-1, y=1); while(y < x, if(isprimepower(x) && isprimepower(y) && !ispseudoprime(x) && !ispseudoprime(y), return(1)); y++; x--)); 0 \\ Felix Fröhlich, Feb 18 2017

Extensions

More terms from Felix Fröhlich, Feb 18 2017
a(28)-a(35) from Giovanni Resta, May 07 2017

A225104 Numbers that can be represented as a sum of two distinct nontrivial prime powers in three or more ways.

Original entry on oeis.org

370, 650, 2210, 3770, 5330, 6290, 7202, 10370, 10730, 11570, 12410, 12818, 13130, 14690, 15170, 15650, 16250, 16490, 18122, 18530, 19370, 19610, 21170, 22490, 24050, 24650, 25010, 26690, 28730, 29930, 30290, 30770, 31610, 32810, 33410, 34970, 36482, 36490
Offset: 1

Views

Author

Alex Ratushnyak, Apr 28 2013

Keywords

Comments

Indices of terms bigger than 2 in A225099.
Nontrivial prime powers are numbers of the form p^k where p is a prime number and k >= 2. That is, A025475 except the first term A025475(1) = 1.
It appears that all terms less than 2^34 are even.

Crossrefs

Programs

  • Maple
    isA025475not1 := proc(n)
        if n <= 1 then
            false;
        elif isprime(n) then
            false;
        elif nops(numtheory[factorset](n)) = 1 then
            true;
        else
            false;
        end if;
    end proc:
    A025475not1 := proc(n)
        option remember;
        local a;
        if n = 1 then
            4;
        else
            for a from procname(n-1)+1 do
                if isA025475not1(a) then
                    return a;
                end if;
            end do:
        end if;
    end proc:
    A225104w := proc(n)
        local a,i,ppi,ppj ;
        a := 0 ;
        for i from 1 do
            ppi := A025475not1(i) ;
            if ppi >= n/2 then
                break;
            end if;
            ppj := n-ppi ;
            if isA025475not1(ppj) then
                a := a+1 ;
            end if;
        end do:
        a ;
    end proc:
    for n from 1 do
        if A225104w(n) >= 3 then
            print(n) ;
        end if;
    end do: # R. J. Mathar, Jun 13 2013
  • Mathematica
    nn = 36490; p = Sort[Flatten[Table[Prime[n]^i, {n, PrimePi[Sqrt[nn]]}, {i, 2, Log[Prime[n], nn]}]]]; Transpose[Sort[Select[Tally[Flatten[Table[p[[i]] + p[[j]], {i, Length[p] - 1}, {j, i + 1, Length[p]}]]], #[[1]] <= nn && #[[2]] > 2 &]]][[1]] (* T. D. Noe, Apr 29 2013 *)

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.

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
Showing 1-7 of 7 results.