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.

A348112 a(n) = t(n)*a(n-1) + a(n-2) for n>1 where t(n) is the Prouhet-Thue-Morse sequence A106400 with a(0)=0 and a(1)=1.

Original entry on oeis.org

0, 1, -1, 0, -1, -1, -2, 1, -3, -2, -5, 3, -2, 5, -7, -2, -5, -7, -12, 5, -7, 12, -19, -7, -26, 19, -45, -26, -19, -45, -64, 19, -83, -64, -147, 83, -64, 147, -211, -64, -275, 211, -486, -275, -211, -486, -697, 211, -486, 697, -1183, -486, -697, -1183, -1880, 697
Offset: 0

Views

Author

Michel Marcus, Oct 01 2021

Keywords

Crossrefs

Programs

  • Mathematica
    a[0] = 0; a[1] = 1; a[n_] := a[n] = (-1)^DigitCount[n, 2, 1]*a[n - 1] + a[n - 2]; Array[a, 50, 0] (* Amiram Eldar, Oct 01 2021 *)
  • PARI
    t(n) = (-1)^hammingweight(n); \\ A106400
    lista(nn) = {my(va = vector(nn)); va[1] = 1; va[2] = -1; for (n=3, nn, va[n] = t(n)*va[n-1] + va[n-2];); concat(0, va);}