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.

A351200 Number of patterns of length n with all distinct runs.

Original entry on oeis.org

1, 1, 3, 11, 53, 305, 2051, 15731, 135697, 1300869, 13726431, 158137851, 1975599321, 26607158781, 384347911211, 5928465081703, 97262304328573, 1691274884085061, 31073791192091251, 601539400910369671, 12238270940611270161, 261071590963047040241
Offset: 0

Views

Author

Gus Wiseman, Feb 09 2022

Keywords

Comments

We define a pattern to be a finite sequence covering an initial interval of positive integers. Patterns are counted by A000670 and ranked by A333217.

Examples

			The a(1) = 1 through a(3) = 11 patterns:
  (1)  (1,1)  (1,1,1)
       (1,2)  (1,1,2)
       (2,1)  (1,2,2)
              (1,2,3)
              (1,3,2)
              (2,1,1)
              (2,1,3)
              (2,2,1)
              (2,3,1)
              (3,1,2)
              (3,2,1)
The complement for n = 3 counts the two patterns (1,2,1) and (2,1,2).
		

Crossrefs

The version for run-lengths instead of runs is A351292.
A000670 counts patterns, ranked by A333217.
A005649 counts anti-run patterns, complement A069321.
A005811 counts runs in binary expansion.
A032011 counts patterns with distinct multiplicities.
A044813 lists numbers whose binary expansion has distinct run-lengths.
A060223 counts Lyndon patterns, necklaces A019536, aperiodic A296975.
A131689 counts patterns by number of distinct parts.
A238130 and A238279 count compositions by number of runs.
A297770 counts distinct runs in binary expansion.
A345194 counts alternating patterns, up/down A350354.
Counting words with all distinct runs:
- A351013 = compositions, for run-lengths A329739, ranked by A351290.
- A351016 = binary words, for run-lengths A351017.
- A351018 = binary expansions, for run-lengths A032020, ranked by A175413.
- A351202 = permutations of prime factors.
- A351642 = word structures.
Row sums of A351640.

Programs

  • Mathematica
    allnorm[n_]:=If[n<=0,{{}},Function[s,Array[Count[s,y_/;y<=#]+1&,n]] /@Subsets[Range[n-1]+1]];
    Table[Length[Select[Join@@Permutations/@allnorm[n],UnsameQ@@Split[#]&]],{n,0,6}]
  • PARI
    \\ here LahI is A111596 as row polynomials.
    LahI(n,y)={sum(k=1, n, y^k*(-1)^(n-k)*(n!/k!)*binomial(n-1, k-1))}
    S(n)={my(p=prod(k=1, n, 1 + y*x^k + O(x*x^n))); 1 + sum(i=1, (sqrtint(8*n+1)-1)\2, polcoef(p,i,y)*LahI(i,y))}
    R(q)={[subst(serlaplace(p), y, 1) | p<-Vec(q)]}
    seq(n)={my(q=S(n)); concat([1], sum(k=1, n, R(q^k-1)*sum(r=k, n, binomial(r, k)*(-1)^(r-k)) ))} \\ Andrew Howroyd, Feb 12 2022

Extensions

Terms a(10) and beyond from Andrew Howroyd, Feb 12 2022

A351641 Triangle read by rows: T(n,k) is the number of length n word structures with all distinct runs using exactly k different symbols.

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 0, 1, 2, 1, 0, 1, 5, 3, 1, 0, 1, 8, 12, 4, 1, 0, 1, 17, 28, 22, 5, 1, 0, 1, 26, 81, 68, 35, 6, 1, 0, 1, 45, 177, 251, 135, 51, 7, 1, 0, 1, 76, 410, 704, 610, 236, 70, 8, 1, 0, 1, 121, 906, 2068, 2086, 1266, 378, 92, 9, 1
Offset: 0

Views

Author

Andrew Howroyd, Feb 15 2022

Keywords

Comments

Permuting the symbols will not change the structure.
Equivalently, T(n,k) is the number of restricted growth strings [s(0), s(1), ..., s(n-1)] where s(0)=0 and s(i) <= 1 + max(prefix) for i >= 1, the maximum value is k and all runs are distinct.

Examples

			Triangle begins:
  1;
  0, 1;
  0, 1,  1;
  0, 1,  2,   1;
  0, 1,  5,   3,   1;
  0, 1,  8,  12,   4,   1;
  0, 1, 17,  28,  22,   5,  1;
  0, 1, 26,  81,  68,  35,  6, 1;
  0, 1, 45, 177, 251, 135, 51, 7, 1;
  ...
The T(4,1) = 1 word is 1111.
The T(4,2) = 5 words are 1112, 1121, 1122, 1211, 1222.
The T(4,3) = 3 words are 1123, 1223, 1233.
The T(4,4) = 1 word is 1234.
		

Crossrefs

Row sums are A351642.
Partial row sums include A000007, A000012, A351018, A351644.
Column k=3 is A351643.

Programs

  • PARI
    \\ here LahI is A111596 as row polynomials.
    LahI(n, y)={sum(k=1, n, y^k*(-1)^(n-k)*(n!/k!)*binomial(n-1, k-1))}
    S(n)={my(p=prod(k=1, n, 1 + y*x^k + O(x*x^n))); 1 + sum(i=1, (sqrtint(8*n+1)-1)\2, polcoef(p, i, y)*LahI(i, y))}
    R(q)={[subst(serlaplace(p), y, 1) | p<-Vec(q)]}
    T(n)={my(q=S(n), v=concat([1], sum(k=1, n, R(q^k-1)*sum(r=k, n, y^r*binomial(r, k)*(-1)^(r-k)/r!) ))); [Vecrev(p) | p<-v]}
    { my(A=T(10)); for(n=1, #A, print(A[n])) }

Formula

T(n,k) = A351640(n,k)/k!.

A350824 Triangle read by rows: T(n,k) is the number of patterns of length n with all distinct run lengths and maximum value k, n >= 0, k = 0..floor(sqrt(8*n+1)-1/2).

Original entry on oeis.org

1, 0, 1, 0, 1, 0, 1, 4, 0, 1, 4, 0, 1, 8, 0, 1, 20, 36, 0, 1, 24, 36, 0, 1, 36, 72, 0, 1, 52, 108, 0, 1, 112, 576, 576, 0, 1, 128, 612, 576, 0, 1, 200, 1116, 1152, 0, 1, 264, 1584, 1728, 0, 1, 384, 2520, 2880, 0, 1, 700, 8064, 20736, 14400, 0, 1, 868, 9432, 22464, 14400
Offset: 0

Views

Author

Andrew Howroyd, Feb 12 2022

Keywords

Examples

			Triangle begins:
  1;
  0, 1;
  0, 1;
  0, 1,   4;
  0, 1,   4;
  0, 1,   8;
  0, 1,  20,   36;
  0, 1,  24,   36;
  0, 1,  36,   72;
  0, 1,  52,  108;
  0, 1, 112,  576,  576;
  0, 1, 128,  612,  576;
  0, 1, 200, 1116, 1152;
  ...
The T(5,1) = 1 pattern is 11111.
The T(5,2) = 8 patterns are 12222, 11222, 11122, 11112, 21111, 22111, 22211, 22221.
		

Crossrefs

Programs

  • PARI
    P(n) = {Vec(-1 + prod(k=1, n, 1 + y*x^k + O(x*x^n)))}
    R(u, k) = {k*[subst(serlaplace(p)/y, y, k-1) | p<-u]}
    T(n)={my(u=P(n), v=concat([1], sum(k=1, n, R(u, k)*sum(r=k, n, y^r*binomial(r, k)*(-1)^(r-k)) ))); [Vecrev(p) | p<-v]}
    { my(A=T(16)); for(n=1, #A, print(A[n])) }

Formula

T(n,k) = Sum_{j=1..k} R(n,j)*binomial(k, j)*(-1)^(k-j) for n > 0, where R(n,k) = Sum_{j=1..A003056(n)} k*(k-1)^(j-1) * j! * A008289(n,j).
T(n,k) = k! * A351637(n,k).
T(A000217(n),n) = A001044(n). - Alois P. Heinz, Feb 15 2022
Showing 1-3 of 3 results.