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.

Showing 1-3 of 3 results.

A274228 Triangle read by rows: T(n,k) (n>=3, 0<=k<=n-3) = number of n-sequences of 0's and 1's with exactly one pair of adjacent 0's and exactly k pairs of adjacent 1's.

Original entry on oeis.org

2, 3, 2, 4, 4, 2, 5, 8, 5, 2, 6, 12, 12, 6, 2, 7, 18, 21, 16, 7, 2, 8, 24, 36, 32, 20, 8, 2, 9, 32, 54, 60, 45, 24, 9, 2, 10, 40, 80, 100, 90, 60, 28, 10, 2, 11, 50, 110, 160, 165, 126, 77, 32, 11, 2, 12, 60, 150, 240, 280, 252, 168, 96, 36, 12, 2, 13, 72, 195, 350, 455, 448, 364, 216, 117, 40, 13, 2
Offset: 3

Views

Author

Jeremy Dover, Jun 14 2016

Keywords

Examples

			n=3 => 100, 001 -> T(3,0) = 2.
n=4 => 0010, 0100, 1001 -> T(4,0) = 3; 0011, 1100 -> T(4,1) = 2.
Triangle starts:
2,
3, 2,
4, 4, 2,
5, 8, 5, 2,
6, 12, 12, 6, 2,
7, 18, 21, 16, 7, 2,
8, 24, 36, 32, 20, 8, 2,
9, 32, 54, 60, 45, 24, 9, 2,
10, 40, 80, 100, 90, 60, 28, 10, 2,
11, 50, 110, 160, 165, 126, 77, 32, 11, 2,
12, 60, 150, 240, 280, 252, 168, 96, 36, 12, 2,
13, 72, 195, 350, 455, 448, 364, 216, 117, 40, 13, 2,
...
		

Crossrefs

Row sums give A001629.
Cf. A073044.
Columns of table:
T(n,0)=A000027(n-1)
T(n,1)=A007590(n-1)
T(n,2)=A080838(n-1)
T(n,3)=A032091(n)

Programs

  • Mathematica
    Table[(k + 1) (Binomial[Floor[(n + k - 2)/2], k + 1] + Binomial[Floor[(n + k - 3)/2], k + 1]) + 2 Binomial[Floor[(n + k - 3)/2], k], {n, 3, 14}, {k, 0, n - 3}] // Flatten (* Michael De Vlieger, Jun 16 2016 *)
  • PARI
    T(n,k) = (k+1)*(binomial((n+k-2)\2,k+1)+binomial((n+k-3)\2,k+1))+2*binomial((n+k-3)\2,k); \\ Michel Marcus, Jun 17 2016

Formula

T(n,k) = (k+1)*(binomial(floor((n+k-2)/2),k+1)+binomial(floor((n+k-3)/2),k+1))+2*binomial(floor((n+k-3)/2),k).
T(n,k) = (k+1)*A073044(n-2,k+1) + 2*A046854(n-3,k).
T(n,k) = A274742(n,k)+A274742(n-1,k)+A046854(n-3,k).

A345123 Number T(n,k) of ordered subsequences of {1,...,n} containing at least k elements and such that the first differences contain only odd numbers; triangle T(n,k), n>=0, 0<=k<=n, read by rows.

Original entry on oeis.org

1, 2, 1, 4, 3, 1, 7, 6, 3, 1, 12, 11, 7, 3, 1, 20, 19, 14, 8, 3, 1, 33, 32, 26, 17, 9, 3, 1, 54, 53, 46, 34, 20, 10, 3, 1, 88, 87, 79, 63, 43, 23, 11, 3, 1, 143, 142, 133, 113, 83, 53, 26, 12, 3, 1, 232, 231, 221, 196, 156, 106, 64, 29, 13, 3, 1, 376, 375, 364, 334, 279, 209, 132, 76, 32, 14, 3, 1
Offset: 0

Views

Author

Alois P. Heinz, Jun 08 2021

Keywords

Comments

The sequence of column k satisfies a linear recurrence with constant coefficients of order 2k if k >= 2 and of order 3 for k in {0, 1}.

Examples

			T(0,0) = 1: [].
T(1,1) = 1: [1].
T(2,2) = 1: [1,2].
T(3,1) = 6: [1], [2], [3], [1,2], [2,3], [1,2,3].
T(4,0) = 12: [], [1], [2], [3], [4], [1,2], [1,4], [2,3], [3,4], [1,2,3], [2,3,4], [1,2,3,4].
T(6,3) = 17: [1,2,3], [1,2,5], [1,4,5], [2,3,4], [2,3,6], [2,5,6], [3,4,5], [4,5,6], [1,2,3,4], [1,2,3,6], [1,2,5,6], [1,4,5,6], [2,3,4,5], [3,4,5,6], [1,2,3,4,5], [2,3,4,5,6], [1,2,3,4,5,6].
Triangle T(n,k) begins:
    1;
    2,   1;
    4,   3,   1;
    7,   6,   3,   1;
   12,  11,   7,   3,   1;
   20,  19,  14,   8,   3,   1;
   33,  32,  26,  17,   9,   3,  1;
   54,  53,  46,  34,  20,  10,  3,  1;
   88,  87,  79,  63,  43,  23, 11,  3,  1;
  143, 142, 133, 113,  83,  53, 26, 12,  3, 1;
  232, 231, 221, 196, 156, 106, 64, 29, 13, 3, 1;
  ...
		

References

  • Chu, Hung Viet, Various Sequences from Counting Subsets, Fib. Quart., 59:2 (May 2021), 150-157.

Crossrefs

Columns k=0-3 give: A000071(n+3), A001911, A001924(n-1), A344004.
T(2n,n) give A340766.

Programs

  • Maple
    b:= proc(n, l, t) option remember; `if`(n=0, `if`(t=0, 1, 0), `if`(0
          in [l, irem(1+l-n, 2)], b(n-1, n, max(0, t-1)), 0)+b(n-1, l, t))
        end:
    T:= (n, k)-> b(n, 0, k):
    seq(seq(T(n, k), k=0..n), n=0..10);
    # second Maple program:
    g:= proc(n, k) option remember; `if`(k>n, 0,
         `if`(k in [0, 1], n^k, g(n-1, k-1)+g(n-2, k)))
        end:
    T:= proc(n, k) option remember;
         `if`(k>n, 0, g(n, k)+T(n, k+1))
        end:
    seq(seq(T(n, k), k=0..n), n=0..10);
    # third Maple program:
    T:= proc(n, k) option remember; `if`(k>n, 0, binomial(iquo(n+k, 2), k)+
          `if`(k>0, binomial(iquo(n+k-1, 2), k), 0)+T(n, k+1))
        end:
    seq(seq(T(n, k), k=0..n), n=0..10);
  • Mathematica
    T[n_, k_] := T[n, k] = If[k > n, 0, Binomial[Quotient[n+k, 2], k] +
         If[k > 0, Binomial[Quotient[n+k-1, 2], k], 0] + T[n, k+1]];
    Table[Table[T[n, k], {k, 0, n}], {n, 0, 11}] // Flatten (* Jean-François Alcover, Nov 06 2021, after 3rd Maple program *)

A129714 Triangle read by rows: T(n,k) is the number of Fibonacci binary words of length n and having k runs (0<=k<=n). A Fibonacci binary word is a binary word having no 00 subword. A run is a maximal sequence of consecutive identical letters.

Original entry on oeis.org

1, 0, 2, 0, 1, 2, 0, 1, 2, 2, 0, 1, 2, 3, 2, 0, 1, 2, 4, 4, 2, 0, 1, 2, 5, 6, 5, 2, 0, 1, 2, 6, 8, 9, 6, 2, 0, 1, 2, 7, 10, 14, 12, 7, 2, 0, 1, 2, 8, 12, 20, 20, 16, 8, 2, 0, 1, 2, 9, 14, 27, 30, 30, 20, 9, 2, 0, 1, 2, 10, 16, 35, 42, 50, 40, 25, 10, 2, 0, 1, 2, 11, 18, 44, 56, 77, 70, 55, 30, 11, 2
Offset: 0

Views

Author

Emeric Deutsch, May 12 2007

Keywords

Comments

Row sums are the Fibonacci numbers (A000045).

Examples

			T(5,3)=4 because we have 10111, 11011, 11101 and 01110.
Triangle starts:
  1;
  0,2;
  0,1,2;
  0,1,2,2;
  0,1,2,3,2;
  0,1,2,4,4,2;
		

Crossrefs

Programs

  • Maple
    T:=proc(n,k): if k<0 then 0 elif k=0 and n=0 then 1 elif k=0 then 0 elif n=1 and k=1 then 2 elif n=2 and k=1 then 1 elif n=2 and k=2 then 2 elif k>n then 0 else T(n-1,k)+T(n-2,k-2) fi end: for n from 0 to 14 do seq(T(n,k),k=0..n) od; # yields sequence in triangular form
  • Mathematica
    T[n_, k_] := T[n, k] = Which[k < 0, 0, k == 0 && n == 0, 1, k == 0, 0, n == 1 && k == 1, 2, n == 2 && k == 1, 1, n == 2 && k == 2, 2, k > n, 0, True, T[n-1, k] + T[n-2, k-2]];
    Table[T[n, k], {n, 0, 12}, {k, 0, n}] // Flatten (* Jean-François Alcover, Aug 23 2024, after Maple program *)

Formula

T(n,k) = A073044(n,n-k) (since in each Fibonacci binary word of length n the number of runs plus the number of 11's is equal to n).
Sum_{k=0..n} k*T(n,k) = A129715(n).
G.f.: G(t,z)=(1+tz)(1-z+tz)/(1-z-t^2*z^2).
T(n,k) = T(n-1,k)+T(n-2,k-2) for n>=3, k>=1 (see the Maple program).
For n >=1, T(n+1,k+1) = binomial(n-floor((k+1)/2),floor(k/2)) + binomial(n-1-floor(k/2),floor((k-1)/2)) = A065941(n,k) + A065941(n-1,k-1). T(n+1,2k) = 2*binomial(n-k,k-1) and T(n+1,2k+1) = n/(n-k)*binomial(n-k,k). For 0 <= k < n and n >=1, T(n+1,k+1) equals the number of facets of the k-dimensional cyclic polytope C_k(n), defined as the convex hull of the n points (1,1^2,...,1^k),...,(n,n^2,...n^k) in R^k [see Henk et al., p.11]. [Peter Bala, Sep 25 2008]
Showing 1-3 of 3 results.