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-7 of 7 results.

A351292 Number of patterns of length n with all distinct run-lengths.

Original entry on oeis.org

1, 1, 1, 5, 5, 9, 57, 61, 109, 161, 1265, 1317, 2469, 3577, 5785, 43901, 47165, 86337, 127665, 204853, 284197, 2280089, 2398505, 4469373, 6543453, 10570993, 14601745, 22502549, 159506453, 171281529, 314077353, 462623821, 742191037, 1031307185, 1580543969, 2141246229
Offset: 0

Views

Author

Gus Wiseman, Feb 10 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(5) = 9 patterns:
  (1)  (1,1)  (1,1,1)  (1,1,1,1)  (1,1,1,1,1)
              (1,1,2)  (1,1,1,2)  (1,1,1,1,2)
              (1,2,2)  (1,2,2,2)  (1,1,1,2,2)
              (2,1,1)  (2,1,1,1)  (1,1,2,2,2)
              (2,2,1)  (2,2,2,1)  (1,2,2,2,2)
                                  (2,1,1,1,1)
                                  (2,2,1,1,1)
                                  (2,2,2,1,1)
                                  (2,2,2,2,1)
The a(6) = 57 patterns grouped by sum:
  111111  111112  111122  112221  111223  111233  112333  122333
          111211  111221  122211  111322  111332  113332  133322
          112111  122111  211122  112222  112223  122233  221333
          211111  221111  221112  211222  113222  133222  223331
                                  221113  122222  211333  333122
                                  222112  211133  222133  333221
                                  222211  221222  222331
                                  223111  222113  233311
                                  311122  222122  331222
                                  322111  222221  332221
                                          222311  333112
                                          233111  333211
                                          311222
                                          322211
                                          331112
                                          332111
		

Crossrefs

The version for runs instead of run-lengths is A351200.
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.
A165413 counts distinct run-lengths in binary expansion, runs A297770.
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.
- A351638 = word structures.
Row sums of A350824.

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@@Length/@Split[#]&]],{n,0,6}]
  • 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]}
    seq(n)={my(u=P(n), c=poldegree(u[#u])); concat([1], sum(k=1, c, R(u, k)*sum(r=k, c, binomial(r, k)*(-1)^(r-k)) ))} \\ Andrew Howroyd, Feb 11 2022

Formula

From Andrew Howroyd, Feb 12 2022: (Start)
a(n) = Sum_{k=1..n} R(n,k)*(Sum_{r=k..n} binomial(r, k)*(-1)^(r-k)), where R(n,k) = Sum_{j=1..floor((sqrt(8*n+1)-1)/2)} k*(k-1)^(j-1) * j! * A008289(n,j).
G.f.: 1 + Sum_{r>=1} Sum_{k=1..r} R(k,x) * binomial(r, k)*(-1)^(r-k), where R(k,x) = Sum_{j>=1} k*(k-1)^(j-1) * j! * [y^j](Product_{k>=1} 1 + y*x^k).
(End)

Extensions

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

A351637 Triangle read by rows: T(n,k) is the number of length n word structures with all distinct run-lengths using exactly k different symbols, n >= 0, k = 0..floor(sqrt(8*n+1)-1/2).

Original entry on oeis.org

1, 0, 1, 0, 1, 0, 1, 2, 0, 1, 2, 0, 1, 4, 0, 1, 10, 6, 0, 1, 12, 6, 0, 1, 18, 12, 0, 1, 26, 18, 0, 1, 56, 96, 24, 0, 1, 64, 102, 24, 0, 1, 100, 186, 48, 0, 1, 132, 264, 72, 0, 1, 192, 420, 120, 0, 1, 350, 1344, 864, 120, 0, 1, 434, 1572, 936, 120
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 every run has a different length.

Examples

			Triangle begins:
  1;
  0, 1;
  0, 1;
  0, 1,   2;
  0, 1,   2;
  0, 1,   4;
  0, 1,  10,   6;
  0, 1,  12,   6;
  0, 1,  18,  12;
  0, 1,  26,  18;
  0, 1,  56,  96, 24;
  0, 1,  64, 102, 24;
  0, 1, 100, 186, 48;
  0, 1, 132, 264, 72;
  ...
The T(6,1) = 1 word is 111111.
The T(6,2) = 10 words are 111112, 111122, 111211, 111221, 112111, 112221, 112222, 122111, 122211, 122222.
The T(6,3) = 6 words are 111223, 111233, 112333, 112223, 122333, 122233.
		

Crossrefs

Row sums are A351638.
Partial row sums include A000007, A000012, A032020, A351639.
Column k=2 is A216695.

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)/r!) ))); [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)/k! for n > 0, where R(n,k) = Sum_{j=1..A003056(n)} k*(k-1)^(j-1) * j! * A008289(n,j).
T(n,k) = A350824(n,k)/k!.
T(A000217(n),n) = A000142(n). - Alois P. Heinz, Feb 15 2022

A351642 Number of length n word structures with all distinct runs using an infinite alphabet.

Original entry on oeis.org

1, 1, 2, 4, 10, 26, 74, 218, 668, 2116, 6928, 23254, 79998, 281694, 1011956, 3704900, 13815692, 52386978, 201787950, 789178950, 3130824160, 12589367840, 51287685476, 211557376938, 883067740514, 3728494418330, 15916998678040, 68672820917088, 299331260431104
Offset: 0

Views

Author

Andrew Howroyd, Feb 15 2022

Keywords

Comments

Permuting the symbols will not change the structure.
Equivalently, a(n) 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 and all runs are distinct.

Examples

			The a(4) = 10 words are 1111, 1112, 1121, 1122, 1211, 1222, 1123, 1223, 1233, 1234.
		

Crossrefs

Row sums of A351641.
The initial terms are similar to A206464.

Programs

  • PARI
    \\ See A351641 for R, S.
    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)/r!) )); }

A242551 Number of n-length words on infinite alphabet {1,2,...} such that the maximal runs of consecutive equal integers have lengths that are at least as great as the integer.

Original entry on oeis.org

1, 1, 2, 5, 11, 24, 53, 118, 261, 577, 1276, 2823, 6246, 13819, 30572, 67635, 149630, 331029, 732344, 1620187, 3584388, 7929844, 17543415, 38811782, 85864379, 189960150, 420254129, 929739922, 2056889538, 4550514023, 10067228909, 22272010878, 49272989918, 109008007822, 241161451563, 533528195645
Offset: 0

Views

Author

Geoffrey Critzer, May 17 2014

Keywords

Comments

In other words, there is no restriction on the length of runs of 1's, the length of runs of 2's must be at least two, the length of runs of 3's must be at least three...
a(n) is the number of n-color integer compositions of n such that no adjacent parts are the same color. - John Tyler Rascoe, Jul 23 2024

Examples

			a(3)=5 because we have: 111, 122, 221, 222, 333.
a(4)=11 because we have:  1111, 1122, 1221, 1222, 2211, 2221, 2222, 3331, 1333, 3333, 4444.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, t) option remember; `if`(n=0, 1,
          `if`(t=0, 0, b(n-1, t)) +add(
          `if`(t=j, 0, b(n-j, j)), j=1..n))
        end:
    a:= n-> b(n, 0):
    seq(a(n), n=0..40);  # Alois P. Heinz, Oct 07 2015
  • Mathematica
    n=nn=35;CoefficientList[Series[1/(1-Sum[v[i]/(1+v[i])/.v[i]->z^i/(1-z),{i,1,n}]),{z,0,nn}],z]
  • PARI
    C_x(N)={my(x='x+O('x^N), h = 1/(1-sum(i=1,N, x^i/(1 - x + x^i)))); Vec(h)}
    C_x(40) \\ John Tyler Rascoe, Jul 23 2024

Formula

G.f.: 1/(1 - Sum_{i>0} x^i/(1 - x + x^i)). - John Tyler Rascoe, Jul 23 2024

A351639 Number of length n word structures with all distinct run-lengths using at most 3 symbols.

Original entry on oeis.org

1, 1, 1, 3, 3, 5, 17, 19, 31, 45, 153, 167, 287, 397, 613, 1695, 2007, 3185, 4565, 6799, 9235, 24057, 27645, 44483, 61619, 92089, 122857, 179355, 385995, 468605, 713849, 996331, 1441447, 1947813, 2766657, 3659135, 7467623, 8930629, 13471885, 18283575, 26484639
Offset: 0

Views

Author

Andrew Howroyd, Feb 15 2022

Keywords

Crossrefs

Column k=3 of A351637.
Cf. A351638.

Programs

  • PARI
    \\ See A351637 for P, R.
    seq(n)={my(u=P(n)); concat([1], sum(k=1, n, R(u, k)*sum(r=k, 3, binomial(r, k)*(-1)^(r-k)/r!) ))}

A351732 Number of length n word structures using an infinite alphabet with all distinct run-lengths and the first run length of a symbol less than that of previous symbols.

Original entry on oeis.org

1, 1, 1, 2, 2, 3, 7, 8, 12, 17, 46, 51, 84, 114, 172, 437, 520, 810, 1153, 1699, 2298, 6075, 6955, 11219, 15561, 23308, 31133, 45544, 107379, 128475, 200201, 281480, 413389, 561028, 806643, 1071165, 2514418, 2952086, 4619012, 6364285, 9436458
Offset: 0

Views

Author

Andrew Howroyd, May 20 2022

Keywords

Comments

Permuting the symbols does not change the structure.

Examples

			The a(3) = 2 word structures are 111, 112.
The a(4) = 2 word structures are 1111, 1112.
The a(5) = 3 word structures are 11111, 11112, 11122.
The a(6) = 7 word structures are 111111, 111112, 111122, 111221, 111211, 112111, 111223.
		

Crossrefs

Row sums of A351645.
Cf. A351638.

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]}
    seq(n)={my(u=P(n)); concat([1], sum(k=1, n, R(u, k)*sum(r=k, n, binomial(r, k)*(-1)^(r-k)/(r!)^2) ))}

A384162 Number of length n words over an n-ary alphabet such that a single letter in every run of letters is marked.

Original entry on oeis.org

1, 6, 45, 460, 5945, 92736, 1694329, 35487432, 838341009, 22054058290, 639434542021, 20260243575936, 696512594466793, 25822887652517970, 1027054229302256625, 43622499402922710256, 1970666970910292873249, 94353519890358073478880, 4772755056209685781141981
Offset: 1

Views

Author

John Tyler Rascoe, May 21 2025

Keywords

Examples

			a(2) = 6 counts: (1#,1), (1,1#), (1#,2#), (2#,1#), (2#,2), (2,2#) where # denotes a mark.
		

Crossrefs

Programs

  • PARI
    a(n) = concat([0],Vec(n*x/(1-x*(1-x+n))+O('x^(n+1))))[n+1]

Formula

a(n) = [x^n] n*x/(1 - x*(1 - x + n)).
a(n) = Sum_{s} Product_{i=1..k} c_i * (n - 1 + [i,1]) where the sum is over all compositions of n, [c_1, c_2, ..., c_k].
Conjecture: a(n) = n * A342168(n-1).
Showing 1-7 of 7 results.