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.

User: Olivier Pirson

Olivier Pirson's wiki page.

Olivier Pirson has authored 1 sequences.

A239447 Partial sums of A030101.

Original entry on oeis.org

0, 1, 2, 5, 6, 11, 14, 21, 22, 31, 36, 49, 52, 63, 70, 85, 86, 103, 112, 137, 142, 163, 176, 205, 208, 227, 238, 265, 272, 295, 310, 341, 342, 375, 392, 441, 450, 491, 516, 573, 578, 615, 636, 689, 702, 747, 776, 837, 840, 875, 894, 945, 956, 999, 1026, 1085
Offset: 0

Author

Olivier Pirson, Mar 18 2014

Keywords

Crossrefs

Cf. A030101.

Programs

  • Mathematica
    Accumulate[Table[FromDigits[Reverse[IntegerDigits[n,2]],2],{n,0,80}]] (* Harvey P. Dale, Jan 10 2023 *)
  • Python
    A = {0: 0, 1: 1, 2: 2, 3: 5}
    def a(n):
        a_n = A.get(n)
        if a_n is not None:
            return a_n
        q, r = divmod(n, 4)
        if r == 0:
            a_n = a(q*2)*6 - a(q)*5 - a(q - 1)*3 - 1
        elif r == 1:
            a_n = a(q*2 + 1)*2 + a(q*2)*4 - a(q)*6 - a(q - 1)*2 - 1
        elif r == 2:
            a_n = a(q*2 + 1)*3 + a(q*2)*3 - a(q)*6 - a(q - 1)*2 - 1
        else:
            a_n = a(q*2 + 1)*6 - a(q)*8 - 1
        A[n] = a_n  # memoization
        return a_n

Formula

a(4n) = 6 a(2n) - 5 a(n) - 3 a(n-1) - 1.
a(4n + 1) = 2 a(2n+1) + 4 a(2n) - 6 a(n) - 2 a(n-1) - 1.
a(4n + 2) = 3 a(2n+1) + 3 a(2n) - 6 a(n) - 2 a(n-1) - 1.
a(4n + 3) = 6 a(2n+1) - 8 a(n) - 1.

Extensions

More terms from Alois P. Heinz, May 19 2014