This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A309759 #15 Apr 04 2025 14:36:55 %S A309759 1,4,5,16,20,21,64,80,84,85,256,320,336,340,341,1024,1280,1344,1360, %T A309759 1364,1365,4096,5120,5376,5440,5456,5460,5461,16384,20480,21504,21760, %U A309759 21824,21840,21844,21845,65536,81920,86016,87040,87296,87360,87376,87380 %N A309759 Numbers that are sums of consecutive powers of 4. %C A309759 Numbers of the form (4^i - 4^j)/3 with i > j. %H A309759 Harvey P. Dale, <a href="/A309759/b309759.txt">Table of n, a(n) for n = 1..1000</a> %e A309759 336 = 4^2 + 4^3 + 4^4, so 336 is in the sequence. %e A309759 +------+--------+ %e A309759 | a(n) | base 4*| %e A309759 +------+--------+ %e A309759 | 1 | 1 | %e A309759 | 4 | 10 | %e A309759 | 5 | 11 | %e A309759 | 16 | 100 | %e A309759 | 20 | 110 | %e A309759 | 21 | 111 | %e A309759 | 64 | 1000 | %e A309759 | 80 | 1100 | %e A309759 | 84 | 1110 | %e A309759 | 85 | 1111 | %e A309759 +------+--------+ %e A309759 * - a(n) written in base 4. %t A309759 Module[{nn=10,k},k=4^Range[0,nn];Table[Accumulate[Reverse[Take[k,n]]],{n,nn}]]//Flatten (* _Harvey P. Dale_, May 29 2021 *) %o A309759 (Python) %o A309759 from math import isqrt %o A309759 def A309759(n): return ((1<<((m:=isqrt(n<<3)+1>>1)<<1))-(1<<m*(m+1)-(n<<1)&-2))//3 # _Chai Wah Wu_, Apr 04 2025 %Y A309759 Cf. A000302, A000695, A023758, A038470, A309758, A309761. %K A309759 nonn %O A309759 1,2 %A A309759 _Ilya Gutkovskiy_, Aug 15 2019