cp's OEIS Frontend

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.

A309759 Numbers that are sums of consecutive powers of 4.

Original entry on oeis.org

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

Views

Author

Ilya Gutkovskiy, Aug 15 2019

Keywords

Comments

Numbers of the form (4^i - 4^j)/3 with i > j.

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.
		

Crossrefs

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