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.

A255973 Trace of the minimal alternating Fibonacci representation of n.

Original entry on oeis.org

0, 1, 2, 3, -1, 5, -2, -1, 8, 1, -3, -2, -1, 13, 1, 2, -5, 1, -3, -2, -1, 21, 1, 2, 3, -1, -8, 1, 2, -5, 1, -3, -2, -1, 34, 1, 2, 3, -1, 5, -2, -1, -13, 1, 2, 3, -1, -8, 1, 2, -5, 1, -3, -2, -1, 55, 1, 2, 3, -1, 5, -2, -1, 8, 1, -3, -2, -1, -21, 1, 2, 3, -1
Offset: 0

Views

Author

Clark Kimberling, Apr 08 2015

Keywords

Comments

See A256655 for definitions.

Examples

			Let R(k) be the minimal alternating Fibonacci representation of k.  The trace of R(k) is the last term.
R(1) = 1, trace = 1
R(2) = 2, trace = 2
R(3) = 3, trace = 3
R(4) = 5 - 1, trace = -1
R(5) = 5, trace = 5
R(6) = 6 - 2, trace = -2
		

Crossrefs

Cf. A000045, A256655 (representations R(n)), A256656 (numbers with positive trace), A256657 (numbers with nonpositive trace), A256663 (positive part of R(n)), A256664 (nonpositive part of R(n)), A256654.

Programs

  • Mathematica
    b[n_] = Fibonacci[n]; bb = Table[b[n], {n, 1, 70}];
    h[0] = {1}; h[n_] := Join[h[n - 1], Table[b[n + 2], {k, 1, b[n]}]];
    g = h[12];  r[0] = {0};
    r[n_] := If[MemberQ[bb, n], {n}, Join[{g[[n]]}, -r[g[[n]] - n]]];
    Table[Last[r[n]], {n, 0, 200}]  (* A255973 *)