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.

A229078 Number of ascending runs in {1,...,n}^n.

Original entry on oeis.org

0, 1, 7, 63, 736, 10625, 182736, 3647119, 82837504, 2109289329, 59500000000, 1841557146671, 62041198952448, 2259914256880657, 88499197217837056, 3707501605224609375, 165444235911082541056, 7834451891982365825441, 392371124973096027488256
Offset: 0

Views

Author

Alois P. Heinz, Sep 12 2013

Keywords

Examples

			a(1) = 1: [1].
a(2) = 7 = 2+2+1+2: [1,1], [2,1], [1,2], [2,2].
		

Crossrefs

Main diagonal of A229079.
Cf. A062023 (nondescending runs), A066274.

Programs

  • Maple
    a:= n-> `if`(n=0, 0, n^(n-1)*(n*(n+2)-1)/2):
    seq(a(n), n=0..25);

Formula

a(n) = n^(n-1)*(n*(n+2)-1)/2 for n>0, a(0) = 0.
E.g.f.: 1/2*W(-x)*(W(-x)^3+W(-x)^2-W(-x)-2)/(1+W(-x))^3, W(x) Lambert's function (principal branch).
a(n) = A062023(n) + A066274(n) for n>0.

A225753 Triangle of transformations with k monotonic runs.

Original entry on oeis.org

1, 3, 1, 10, 16, 1, 35, 155, 65, 1, 126, 1246, 1506, 246, 1, 462, 9142, 24017, 12117, 917, 1, 1716, 63792, 315918, 349840, 88852, 3424, 1, 6435, 432399, 3707559, 7635987, 4362297, 619677, 12861, 1, 24310, 2881450, 40455910, 140543458, 149803270, 49462810, 4200670, 48610, 1
Offset: 1

Views

Author

Chad Brewbaker, May 14 2013

Keywords

Comments

Analogous to the Eulerian triangle for permutations A173018.
T(n,k) is the number of words of length n over the alphabet {0,1,...,n-1} that have k-1 descents, see example. [Joerg Arndt, Jun 25 2013]
The expected number of descents is (Sum_{k=1..n} (k-1)*T(n,k)) / (Sum_{k=1..n} T(n,k)) = (n + 1/n -2)/2. - Geoffrey Critzer, Jun 26 2013

Examples

			T(1,1) = #{[0]} = 1.
T(2,1) = #{[0,0], [0,1], [1,1]} = 3.
T(2,2) = #{[1,0]} = 1.
T(3,1) = #{[0,0,0], [0,0,1], [0,0,2], [0,1,1], [0,1,2], [0,2,2], [1,1,1], [1,1,2], [1,2,2], [2,2,2]} = 10.
Triangle T(n,k) begins:
     1;
     3,     1;
    10,    16,      1;
    35,   155,     65,      1;
   126,  1246,   1506,    246,     1;
   462,  9142,  24017,  12117,   917,    1;
  1716, 63792, 315918, 349840, 88852, 3424,  1;
  ...
		

Crossrefs

First column is A001700(n-1).
Row sums give: A000312.

Programs

  • Maple
    b:= proc(n, l, k) option remember; local j;
          if n=0 then [1] else []; for j to k do zip((x, y)->x+y,
           %, [`if`(j b(n, 0, n)[]:
    seq(T(n), n=1..10);  # Alois P. Heinz, Jun 26 2013
  • Mathematica
    Table[Distribution[Map[Length,Map[Split[#,LessEqual[#1,#2]&]&,Tuples[Range[1,n],n]]]],{n,1,7}]//Grid (* Geoffrey Critzer, Jun 25 2013 *)
    zip[f_, x_, y_, z_] := With[{m = Max[Length[x], Length[y]]}, f[PadRight[x, m, z], PadRight[y, m, z]]];
    b[n_, l_, k_] := b[n, l, k] = Module[{j, pc}, If[n == 0, {1}, pc = {}; For[j = 1, j <= k, j++, pc = zip[Plus, pc, Join[If[jJean-François Alcover, Dec 05 2023, after Alois P. Heinz *)

A226998 The number of descents over all functions f:{1,2,...,n}->{1,2,...,n}.

Original entry on oeis.org

0, 1, 18, 288, 5000, 97200, 2117682, 51380224, 1377495072, 40500000000, 1296871230050, 44952006426624, 1677462128818632, 67068898339975168, 2860906750488281250, 129703669268270284800, 6228632560085359165568, 315864220382241648869376, 16868630748261621128320242
Offset: 1

Views

Author

Geoffrey Critzer, Jun 26 2013

Keywords

Comments

A descent is an element j in {1,2,...,n-1} such that f(j) > f(j+1).

Crossrefs

Cf. A225753.

Programs

  • Mathematica
    Table[(n + 1/n -2)*n^n/2,{n,1,20}]

Formula

a(n) = (n + 1/n -2)*n^n/2 = A062023(n) - n^n.
Showing 1-3 of 3 results.