A309759 Numbers that are sums of consecutive powers of 4.
1, 4, 5, 16, 20, 21, 64, 80, 84, 85, 256, 320, 336, 340, 341, 1024, 1280, 1344, 1360, 1364, 1365, 4096, 5120, 5376, 5440, 5456, 5460, 5461, 16384, 20480, 21504, 21760, 21824, 21840, 21844, 21845, 65536, 81920, 86016, 87040, 87296, 87360, 87376, 87380
Offset: 1
Keywords
Examples
336 = 4^2 + 4^3 + 4^4, so 336 is in the sequence. +------+--------+ | a(n) | base 4*| +------+--------+ | 1 | 1 | | 4 | 10 | | 5 | 11 | | 16 | 100 | | 20 | 110 | | 21 | 111 | | 64 | 1000 | | 80 | 1100 | | 84 | 1110 | | 85 | 1111 | +------+--------+ * - a(n) written in base 4.
Links
- Harvey P. Dale, Table of n, a(n) for n = 1..1000
Programs
-
Mathematica
Module[{nn=10,k},k=4^Range[0,nn];Table[Accumulate[Reverse[Take[k,n]]],{n,nn}]]//Flatten (* Harvey P. Dale, May 29 2021 *)
-
Python
from math import isqrt def A309759(n): return ((1<<((m:=isqrt(n<<3)+1>>1)<<1))-(1<
Chai Wah Wu, Apr 04 2025
Comments