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”).

A038470
Sums of 2 distinct powers of 4.
6
5, 17, 20, 65, 68, 80, 257, 260, 272, 320, 1025, 1028, 1040, 1088, 1280, 4097, 4100, 4112, 4160, 4352, 5120, 16385, 16388, 16400, 16448, 16640, 17408, 20480, 65537, 65540, 65552, 65600, 65792, 66560, 69632, 81920, 262145, 262148, 262160, 262208, 262400, 263168
OFFSET
1,1
LINKS
MATHEMATICA
Sort[Plus @@@ Subsets[4^Range[0, 9], {2}]] (* Amiram Eldar, Jul 13 2022 *)
PROG
(Python)
def aupto(limit):
p = [4**i for i in range(limit//4+1) if 4**i < limit]
p2 = set(a+b for i, a in enumerate(p) for b in p[i+1:] if a+b <= limit)
return sorted(p2)
print(aupto(265000)) # Michael S. Branicky, May 17 2021
CROSSREFS
Base-4 interpretation of A038444.
Sequence in context: A045119 A045095 A061940 * A043003 A246329 A351176
KEYWORD
nonn,easy
EXTENSIONS
Offset corrected by Amiram Eldar, Jul 13 2022
STATUS
approved