login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Sums of 2 distinct powers of 4.
6

%I #13 Jul 13 2022 05:59:20

%S 5,17,20,65,68,80,257,260,272,320,1025,1028,1040,1088,1280,4097,4100,

%T 4112,4160,4352,5120,16385,16388,16400,16448,16640,17408,20480,65537,

%U 65540,65552,65600,65792,66560,69632,81920,262145,262148,262160,262208,262400,263168

%N Sums of 2 distinct powers of 4.

%H Amiram Eldar, <a href="/A038470/b038470.txt">Table of n, a(n) for n = 1..10000</a>

%t Sort[Plus @@@ Subsets[4^Range[0, 9], {2}]] (* _Amiram Eldar_, Jul 13 2022 *)

%o (Python)

%o def aupto(limit):

%o p = [4**i for i in range(limit//4+1) if 4**i < limit]

%o p2 = set(a+b for i, a in enumerate(p) for b in p[i+1:] if a+b <= limit)

%o return sorted(p2)

%o print(aupto(265000)) # _Michael S. Branicky_, May 17 2021

%Y Base-4 interpretation of A038444.

%Y Cf. A000302, A038471, A038472, A038473.

%K nonn,easy

%O 1,1

%A _Olivier Gérard_

%E Offset corrected by _Amiram Eldar_, Jul 13 2022