login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Number of increasing runs in all Carlitz compositions of n.
2

%I #16 Mar 05 2022 01:36:12

%S 0,1,1,4,6,11,26,46,84,167,313,576,1086,2016,3710,6876,12660,23196,

%T 42542,77798,141910,258648,470558,854644,1550588,2809620,5084588,

%U 9192349,16601714,29953754,53997062,97257129,175033355,314771224,565664138,1015841191

%N Number of increasing runs in all Carlitz compositions of n.

%C No two adjacent parts of a Carlitz composition are equal.

%H Alois P. Heinz, <a href="/A285994/b285994.txt">Table of n, a(n) for n = 0..2000</a>

%F a(n) = Sum_{k=0..floor(n/3)} (k+1) * A241701(n,k) for n>0, a(0) = 0.

%e a(1) = 1: (1).

%e a(2) = 1: (2).

%e a(3) = 4: (12), (2)(1), (3).

%e a(4) = 6: (12)(1), (13), (3)(1), (4).

%e a(5) = 11: (2)(12), (13)(1), (23), (3)(2), (14), (4)(1), (5).

%p b:= proc(n, l) option remember; `if`(n=0, [1, 0], add(`if`(j=l, 0,

%p (p-> p+`if`(j>l, [0, p[1]], 0))(b(n-j, j))), j=1..n))

%p end:

%p a:= n-> b(n, 0)[2]:

%p seq(a(n), n=0..40);

%t b[n_, l_] := b[n, l] = If[n == 0, {1, 0}, Sum[If[j == l, {0, 0}, Function[p, p + If[j > l, {0, p[[1]]}, 0]][b[n - j, j]]], {j, 1, n}]];

%t a[n_] := b[n, 0][[2]];

%t Table[a[n], {n, 0, 40}] (* _Jean-François Alcover_, Mar 05 2022, after _Alois P. Heinz_ *)

%Y Cf. A003242, A241701.

%K nonn

%O 0,4

%A _Alois P. Heinz_, Apr 30 2017