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

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

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

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