A038470 Sums of 2 distinct powers of 4.
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
Links
- Amiram Eldar, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
Sort[Plus @@@ Subsets[4^Range[0, 9], {2}]] (* Amiram Eldar, Jul 13 2022 *)
-
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
-
Python
from math import isqrt def A038470(n): return (1<<(m:=isqrt(n<<3)+1&-2))+(1<<(n-1<<1)-((k:=m>>1)*(k-1))) # Chai Wah Wu, Apr 05 2025
Extensions
Offset corrected by Amiram Eldar, Jul 13 2022