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.

A254575 Triangle T(n,k) in which the n-th row encodes how to hang a picture by wrapping rope around n nails using a polynomial number of twists, such that removing one nail causes the picture to fall; n>=1, 1<=k<=A073121(n).

Original entry on oeis.org

1, 1, 2, -1, -2, 1, 2, -1, -2, 3, 2, 1, -2, -1, -3, 1, 2, -1, -2, 3, 4, -3, -4, 2, 1, -2, -1, 4, 3, -4, -3, 1, 2, -1, -2, 3, 2, 1, -2, -1, -3, 4, 5, -4, -5, 3, 1, 2, -1, -2, -3, 2, 1, -2, -1, 5, 4, -5, -4, 1, 2, -1, -2, 3, 2, 1, -2, -1, -3, 4, 5, -4, -5, 6, 5
Offset: 1

Views

Author

Alois P. Heinz, Feb 01 2015

Keywords

Comments

In step k the rope has to be wrapped around nail |T(n,k)| clockwise if T(n,k)>0 and counterclockwise if T(n,k)<0.
1 or (-1) appears A062383(n-1) times in row n.
n or (-n) appears A053644(n) times in row n.

Examples

			Triangle T(n,k) begins:
  1;
  1, 2, -1, -2;
  1, 2, -1, -2, 3, 2,  1, -2, -1, -3;
  1, 2, -1, -2, 3, 4, -3, -4,  2,  1, -2, -1, 4, 3, -4, -3;
		

Crossrefs

Row sums give A063524.

Programs

  • Maple
    r:= s-> seq(-s[-k], k=1..nops(s)):
    T:= proc(n) option remember; `if`(n=1, 1, (m->
          ((x, y)-> [x[], y[], r(x), r(y)][])([T(m)],
           map(h-> h+sign(h)*m, [T(n-m)])))(iquo(n+1, 2)))
        end:
    seq(T(n), n=1..7);
  • Mathematica
    r[s_List] := -Reverse[s];
    T[1] = {1}; T[n_] := T[n] = Module[{ m = Quotient[n+1, 2]}, Function[{x, y}, {x, y, r[x], r[y]} // Flatten][T[m], Function[h, h + Sign[h]*m] /@ T[n - m]]];
    Table[T[n], {n, 1, 7}] // Flatten (* Jean-François Alcover, Nov 06 2017, after Alois P. Heinz *)