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.

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

This page as a plain text file.
%I A282533 #37 Feb 25 2019 10:27:22
%S A282533 41,89,113,137,593,857,2213
%N A282533 Primes that are the sum of two proper prime powers (A246547) in more than one way.
%C A282533 Primes of the form 2^k + p^e in more than one way where p is an odd prime (e > 1, k > 1).
%C A282533 Prime terms in A225103.
%C A282533 29 = 2^4 + 5^2 = 2 + 3^3 is a border case not included in this sequence - _Olivier Gérard_, Feb 25 2019
%C A282533 a(8) > 10^8 if it exists. - _Robert Israel_, Feb 17 2017
%C A282533 a(8) > 10^18 if it exists. - _Charles R Greathouse IV_, Feb 19 2017
%e A282533 41 = 2^4 + 5^2 = 2^5 + 3^2.
%e A282533 89 = 2^3 + 3^4 = 2^6 + 5^2.
%e A282533 113 = 2^5 + 3^4 = 2^6 + 7^2.
%e A282533 137 = 2^7 + 3^2 = 2^4 + 11^2.
%e A282533 593 = 2^9 + 3^4 = 2^6 + 23^2.
%e A282533 857 = 2^7 + 3^6 = 2^4 + 29^2.
%e A282533 2213 = 2^4 + 13^3 = 2^2 + 47^2.
%p A282533 N:= 10^6: # to get all terms <= N
%p A282533 B:= Vector(N):
%p A282533 C:= Vector(N):
%p A282533 for k from 2 to ilog2(N) do B[2^k]:= 1 od:
%p A282533 p:= 2:
%p A282533 do
%p A282533   p:= nextprime(p);
%p A282533   if p^2 > N then break fi;
%p A282533   for k from 2 to floor(log[p](N)) do C[p^k]:= 1 od:
%p A282533 od:
%p A282533 R:= SignalProcessing:-Convolution(B,C):
%p A282533 select(t -> isprime(t) and R[t-1] > 1.5, [seq(i,i=3..N,2)]); # _Robert Israel_, Feb 17 2017
%t A282533 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 *)
%t A282533 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 *)
%o A282533 (MATLAB)
%o A282533 N = 10^8; % to get all terms <= N
%o A282533 C = sparse(1,N);
%o A282533 for p = primes(sqrt(N))
%o A282533   C(p .^ [2:floor(log(N)/log(p))]) = 1;
%o A282533 end
%o A282533 R = zeros(1,N);
%o A282533 for k = 2: floor(log2(N))
%o A282533   R((2^k+1):N) = R((2^k+1):N) + C(1:(N-2^k));
%o A282533 end
%o A282533 P = primes(N);
%o A282533 P(R(P) > 1.5) % _Robert Israel_, Feb 17 2017
%o A282533 (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
%o A282533 (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
%o A282533 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
%Y A282533 Cf. A225099, A225102, A225103, A246547.
%Y A282533 Cf. A115231 (prime numbers which cannot be written as 2^a + p^b, b>=0)
%K A282533 nonn,more
%O A282533 1,1
%A A282533 _Altug Alkan_, Feb 17 2017