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.

A330381 Triangle read by rows: T(n,k) is the number of ternary strings of length n with k indispensable digits, with 0 <= k <= n.

Original entry on oeis.org

1, 1, 2, 1, 5, 3, 1, 9, 13, 4, 1, 14, 35, 26, 5, 1, 20, 75, 96, 45, 6, 1, 27, 140, 267, 216, 71, 7, 1, 35, 238, 623, 750, 427, 105, 8, 1, 44, 378, 1288, 2123, 1800, 770, 148, 9, 1, 54, 570, 2436, 5211, 6046, 3858, 1296, 201, 10, 1, 65, 825, 4302, 11505, 17303
Offset: 0

Views

Author

Ji Young Choi, Dec 12 2019

Keywords

Comments

A digit in a string is called indispensable, if it is greater than the following digit or equal to the following digits which are eventually greater than the following digit. We also assume that there is an invisible digit 0 at the end of any string. For example, in 7233355548, the digits 7, 5, 5, 5, and 8 are indispensable.
T(n, k) is also the number of integers m where the length of the ternary representation of m is less than or equal to n and the digit sum of the ternary representation of 2m is 2k.

Examples

			Triangle begins
  1;
  1,  2;
  1,  5,  3;
  1,  9, 13,  4;
  1, 14, 35, 26,  5;
  1, 20, 75, 96, 45, 6;
  ...
There is 1 string (00) of length 2 with 0 indispensable digits.
There are 5 strings (01, 02, 10, 20, 12) of length 2 with 1 indispensable digit.
There are 3 strings (11, 21, 22) of length 2 with 2 indispensable digits.
Hence T(2, 0) = 1, T(2, 1) = 5, T(2, 2) = 3.
		

Crossrefs

Programs

  • Mathematica
    Table[Total@ Map[Sum[Binomial[n, i] Binomial[n - i, # - 2 i], {i, 0, n}] &, 2 k + {-1, 0}], {n, 0, 10}, {k, 0, n}] // Flatten (* Michael De Vlieger, Dec 23 2019, after Adi Dani at A027907 *)
  • PARI
    A027907(n, k) = if(n<0, 0, polcoeff((1 + x + x^2)^n, k));
    T(n, k) = A027907(n, 2*k-1) + A027907(n, 2*k); \\ Jinyuan Wang, Dec 14 2019

Formula

T(n, k) = A027907(n, 2k-1) + A027907(n, 2k).

Extensions

More terms from Jinyuan Wang, Dec 14 2019