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.

A213626 a(n) = Sum_{0<=iA020985(m).

Original entry on oeis.org

0, 0, 1, -2, -2, 0, -5, -4, 0, 8, 21, 2, -10, -16, -15, -20, -20, -16, -7, -22, -14, 0, -21, -8, -28, -40, -45, -46, -42, -32, -49, -40, -24, 0, 33, -10, 22, 64, 11, 52, 104, 168, 245, 154, 78, 16, 65, 4, -44, -80, -105, -90, -114, -128, -123, -136, -132, -120
Offset: 0

Views

Author

Alois P. Heinz, Jun 23 2012

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n) option remember; local r;
          `if`(n=0, 1, `if`(irem(n, 2, 'r')=0, b(r), b(r)*(-1)^r))
        end:
    s:= proc(j) option remember; `if`(j<0, 0, s(j-1)+b(j)       ) end:
    t:= proc(k) option remember; `if`(k<1, 0, t(k-1)+b(k)*s(k-1)) end:
    a:= proc(n) option remember; `if`(n<2, 0, a(n-1)+b(n)*t(n-1)) end:
    seq(a(n), n=0..100);
  • Mathematica
    b[n_] := b[n] = Module[{q, r}, If[n==0, 1, {q, r}=QuotientRemainder[n, 2]; If[r == 0, b[q], b[q]*(-1)^q]]];
    s[j_] := s[j] = If[j < 0, 0, s[j-1] + b[j]];
    t[k_] := t[k] = If[k < 1, 0, t[k-1] + b[k]*s[k-1]];
    a[n_] := a[n] = If[n < 2, 0, a[n-1] + b[n]*t[n-1]];
    Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Jun 01 2022, after Alois P. Heinz *)
  • Python
    def A213626(n): return sum((-1 if (i&(i>>1)).bit_count()&1 else 1)*sum((-1 if (j&(j>>1)).bit_count()&1 else 1)*sum(-1 if (k&(k>>1)).bit_count()&1 else 1 for k in range(j+1,n+1)) for j in range(i+1,n+1)) for i in range(n+1)) # Chai Wah Wu, Feb 12 2023