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

%I #11 Feb 17 2017 18:50:35

%S 36,41,57,89,113,129,130,137,153,177,185,297,305,368,370,377,410,425,

%T 537,545,561,593,633,650,657,850,857,868,873,890,969,986,1010,1130,

%U 1385,1490,1690,1730,1802,1865,1881,1898,1970,2210,2213,2217,2236,2330,2337

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

%C Indices of terms bigger than 1 in A225099.

%C 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.

%C Only 267 of the terms below 2^34 are odd.

%H Robert Israel, <a href="/A225103/b225103.txt">Table of n, a(n) for n = 1..10000</a>

%e 36 = 32 + 4 = 27 + 9, so 36 is in the sequence.

%e 41 = 32 + 9 = 25 + 16, so 41 is in the sequence.

%p N:= 10^4: # to get all terms <= N

%p PP:= [seq(seq(p^k, k=2..floor(log[p](N))),p = select(isprime, [2,seq(i,i=3..floor(sqrt(N)),2)]))]:

%p npp:= nops(PP):

%p res:= {}: R:= 'R':

%p for i from 2 to npp do

%p for j from 1 to i-1 do

%p q:= PP[i]+PP[j];

%p if assigned(R[q]) then res:= res union {q}

%p else R[q]:= 1

%p fi

%p od od:

%p sort(convert(res,list)); # _Robert Israel_, Feb 17 2017

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

%Y Cf. A025475, A225099, A225102.

%K nonn

%O 1,1

%A _Alex Ratushnyak_, Apr 28 2013