login
Higher powers that are sums of two distinct higher powers.
4

%I #21 Feb 14 2018 04:02:29

%S 243,2744,6561,177147,185193,474552,614656,810000,941192,1124864,

%T 1419857,1500625,3241792,4782969,7962624,11239424,16003008,17850625,

%U 21952000,26873856,28372625,52200625,68574961,82312875,117649000,129140163,162771336,200201625,238328000

%N Higher powers that are sums of two distinct higher powers.

%C x is in the sequence iff there are distinct y,z such that x = y + z and x,y,z are all in A076467.

%H Robert Israel and Reinhard Zumkeller, <a href="/A226777/b226777.txt">Table of n, a(n) for n = 1..1000</a> (first 264 terms from Robert Israel)

%e 243 is in the sequence because 243 = 3^5 = 3^3 + 6^3.

%p N := 10^12: # to get terms up to N

%p S := {seq(seq(a^x, a=1 .. floor(N^(1/x))), x = 3 .. floor(log[2](N)))}:

%p f:= proc(n) local L; L:= S[1..n-1] minus {S[n]/2}; nops(map2(`-`,S[n],L) intersect L) > 0 end proc;

%p A:= map(t -> S[t], select(f,[$1..nops(S)]));

%t max = 3*10^8; pp = Join[{1}, Table[n^k, {k, 3, Floor[Log[2, max]]}, {n, 2, Floor[max^(1/k)]}] // Flatten // Union]; Select[Total /@ Subsets[pp, {2}], MemberQ[pp, #]&] // Union (* _Jean-François Alcover_, Feb 14 2018 *)

%o (Haskell)

%o import qualified Data.Set as Set (null, split, filter)

%o import Data.Set (Set, empty, insert, member)

%o a226777 n = a226777_list !! (n-1)

%o a226777_list = f a076467_list empty where

%o f (x:xs) s | Set.null $ Set.filter ((`member` s) . (x -)) s'

%o = f xs (x `insert` s)

%o | otherwise = x : f xs (x `insert` s)

%o where (s', _) = Set.split (x `div` 2) s

%o -- _Reinhard Zumkeller_, Sep 13, Jun 19 2013

%K nonn

%O 1,1

%A _Robert Israel_, Jun 17 2013