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.

A106356 Triangle T(n,k) 0<=k

Original entry on oeis.org

1, 1, 1, 3, 0, 1, 4, 3, 0, 1, 7, 6, 2, 0, 1, 14, 7, 8, 2, 0, 1, 23, 20, 10, 8, 2, 0, 1, 39, 42, 22, 13, 9, 2, 0, 1, 71, 72, 58, 28, 14, 10, 2, 0, 1, 124, 141, 112, 72, 33, 16, 11, 2, 0, 1, 214, 280, 219, 150, 92, 36, 18, 12, 2, 0, 1, 378, 516, 466, 311, 189, 112, 40, 20, 13, 2, 0, 1
Offset: 1

Views

Author

Christian G. Bower, Apr 29 2005

Keywords

Comments

For n > 0, also the number of compositions of n with k + 1 maximal anti-runs (sequences without adjacent equal terms). - Gus Wiseman, Mar 23 2020

Examples

			T(4,1) = 3 because the compositions of 4 with 1 adjacent equal part are 1+1+2, 2+1+1, 2+2.
Triangle begins:
   1;
   1,  1;
   3,  0,  1;
   4,  3,  0, 1;
   7,  6,  2, 0, 1;
  14,  7,  8, 2, 0, 1;
  23, 20, 10, 8, 2, 0, 1;
  ...
From _Gus Wiseman_, Mar 23 2020 (Start)
Row n = 6 counts the following compositions (empty column shown by dot):
  (6)     (33)    (222)    (11112)  .  (111111)
  (15)    (114)   (1113)   (21111)
  (24)    (411)   (1122)
  (42)    (1131)  (2211)
  (51)    (1221)  (3111)
  (123)   (1311)  (11121)
  (132)   (2112)  (11211)
  (141)           (12111)
  (213)
  (231)
  (312)
  (321)
  (1212)
  (2121)
(End)
		

Crossrefs

Row sums: 2^(n-1)=A000079(n-1). Columns 0-4: A003242, A106357-A106360.
The version counting adjacent unequal parts is A238279.
The k-th composition in standard-order has A124762(k) adjacent equal parts and A333382(k) adjacent unequal parts.
The k-th composition in standard-order has A124767(k) maximal runs and A333381(k) maximal anti-runs.
The version for ascents/descents is A238343.
The version for weak ascents/descents is A333213.

Programs

  • Maple
    b:= proc(n, h, t) option remember;
          if n=0 then `if`(t=0, 1, 0)
        elif t<0 then 0
        else add(b(n-j, j, `if`(j=h, t-1, t)), j=1..n)
          fi
        end:
    T:= (n, k)-> b(n, -1, k):
    seq(seq(T(n, k), k=0..n-1), n=1..15); # Alois P. Heinz, Oct 23 2011
  • Mathematica
    b[n_, h_, t_] := b[n, h, t] = If[n == 0, If[t == 0, 1, 0], If[t<0, 0, Sum[b[n-j, j, If [j == h, t-1, t]], {j, 1, n}]]]; T[n_, k_] := b[n, -1, k]; Table[Table[T[n, k], {k, 0, n-1}], {n, 1, 15}] // Flatten (* Jean-François Alcover, Feb 20 2015, after Alois P. Heinz *)
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],n==0||Length[Split[#,#1!=#2&]]==k+1&]],{n,0,12},{k,0,n}] (* Gus Wiseman, Mar 23 2020 *)

A241902 Decimal expansion of a constant related to Carlitz compositions (A003242).

Original entry on oeis.org

1, 7, 5, 0, 2, 4, 1, 2, 9, 1, 7, 1, 8, 3, 0, 9, 0, 3, 1, 2, 4, 9, 7, 3, 8, 6, 2, 4, 6, 3, 9, 8, 1, 5, 8, 7, 8, 7, 7, 8, 2, 0, 5, 8, 1, 8, 1, 3, 8, 1, 5, 9, 0, 5, 6, 1, 3, 1, 6, 5, 8, 6, 1, 3, 1, 7, 5, 1, 9, 3, 5, 1, 6, 7, 1, 5, 2, 0, 6, 0, 5, 0, 7, 7, 7, 4, 3, 8, 8, 7, 5, 6, 5, 7, 0, 9, 2, 4, 7, 1, 4, 1, 0, 0, 1
Offset: 1

Views

Author

Vaclav Kotesovec, May 01 2014

Keywords

Examples

			1.7502412917183090312497386246398158787782...
		

Crossrefs

Programs

  • Mathematica
    RealDigits[r /. FindRoot[Exp[QPolyGamma[0, 1 + Pi*I/Log[r], r]] == r^(3/2)/(1-r), {r, 3/2}, WorkingPrecision -> 120], 10, 110][[1]] (* Vaclav Kotesovec, Jun 19 2023 *)

Formula

Equals lim n -> infinity A003242(n)^(1/n).

A337507 Number of length-n sequences covering an initial interval of positive integers with exactly two maximal anti-runs, or with one pair of adjacent equal parts.

Original entry on oeis.org

0, 0, 1, 4, 24, 176, 1540, 15672, 181916, 2372512, 34348932, 546674120, 9486840748, 178285201008, 3607174453844, 78177409231768, 1806934004612220, 44367502983673664, 1153334584544496676, 31643148872573831016
Offset: 0

Views

Author

Gus Wiseman, Sep 06 2020

Keywords

Comments

An anti-run is a sequence with no adjacent equal parts. For example, the maximal anti-runs in (3,1,1,2,2,2,1) are ((3,1),(1,2),(2),(2,1)). In general, there is one more maximal anti-run than the number of pairs of adjacent equal parts.

Examples

			The a(4) = 24 sequences:
  (2,1,2,2)  (2,1,3,3)  (3,1,2,2)
  (2,2,1,2)  (2,3,3,1)  (3,2,2,1)
  (1,2,2,1)  (3,3,1,2)  (1,1,2,3)
  (2,1,1,2)  (3,3,2,1)  (1,1,3,2)
  (1,1,2,1)  (1,2,2,3)  (2,1,1,3)
  (1,2,1,1)  (1,3,2,2)  (2,3,1,1)
  (1,2,3,3)  (2,2,1,3)  (3,1,1,2)
  (1,3,3,2)  (2,2,3,1)  (3,2,1,1)
		

Crossrefs

A002133 is the version for runs in partitions.
A106357 is the version for compositions.
A337506 has this as column k = 2.
A000670 counts patterns.
A005649 counts anti-run patterns.
A003242 counts anti-run compositions.
A106356 counts compositions by number of maximal anti-runs.
A124762 counts adjacent equal terms in standard compositions.
A124767 counts maximal runs in standard compositions.
A238130/A238279/A333755 count maximal runs in compositions.
A333381 counts maximal anti-runs in standard compositions.
A333382 counts adjacent unequal terms in standard compositions.
A333489 ranks anti-run compositions.
A333769 gives maximal run lengths in standard compositions.
A337565 gives maximal anti-run lengths in standard compositions.

Programs

  • Mathematica
    kv=2;
    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],Length[Split[#,UnsameQ]]==kv&]],{n,0,6}]

Formula

a(n > 0) = (n - 1)*A005649(n - 2).
Showing 1-3 of 3 results.