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.

A256655 R(k), the minimal alternating Fibonacci representation of k, concatenated for k = 0, 1, 2,....

Original entry on oeis.org

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

Views

Author

Clark Kimberling, Apr 08 2015

Keywords

Comments

Suppose that b = (b(0), b(1), ... ) is an increasing sequence of positive integers satisfying b(0) = 1 and b(n+1) <= 2*b(n) for n >= 0. Let B(n) be the least b(m) >= n. Let R(0) = 1, and for n > 0, let R(n) = B(n) - R(B(n) - n). The resulting sum of the form R(n) = B(n) - B(m(1)) + B(m(2)) - ... + ((-1)^k)*B(k) is introduced here as the minimal alternating b-representation of n. The sum B(n) + B(m(2)) + ... we call the positive part of R(n), and the sum B(m(1)) + B(m(3)) + ... , the nonpositive part of R(n). The number ((-1)^k)*B(k) is the trace of n.
If b(n) = F(n+2), where F = A000045, then the sum is the minimal alternating Fibonacci-representation of n.

Examples

			R(0) = 0
R(1) = 1
R(2) = 2
R(3) = 3
R(4) = 5 - 1
R(9) = 13 - 5 + 1
R(25) = 34 - 13 + 5 - 1
R(64) = 89 - 34 + 13 - 5 + 1
		

Crossrefs

Cf. A000045, A255973 (trace), A256656 (numbers with positive trace), A256657 (numbers with nonpositive trace), A256663 (positive part of R(n)), A256664 (nonpositive part of R(n)), A256654, A256696 (minimal alternating binary representations), A255974 (minimal alternating triangular-number representations), A256789 (minimal alternating squares representations).

Programs

  • Mathematica
    f[n_] = Fibonacci[n]; ff = Table[f[n], {n, 1, 70}];
    s[n_] := Table[f[n + 2], {k, 1, f[n]}];
    h[0] = {1}; h[n_] := Join[h[n - 1], s[n]];
    g = h[12]; r[0] = {0};
    r[n_] := If[MemberQ[ff, n], {n}, Join[{g[[n]]}, -r[g[[n]] - n]]];
    Flatten[Table[r[n], {n, 0, 60}]]

Formula

R(F(k)^2) = F(2k-1) - F(2k-3) + F(2k-5) - ... + d*F(5) + (-1)^k, where d = (-1)^(k+1).