login
Irregular triangle read by rows: T(n,k) = number of times k appears in n-th row of A342585, n >= 0..
2

%I #11 Oct 13 2021 10:26:30

%S 1,1,2,1,0,3,1,2,1,1,1,1,1,0,0,4,1,2,1,0,1,2,1,1,2,0,2,0,1,2,1,1,0,1,

%T 1,2,1,1,1,0,1,1,1,1,1,2,1,1,0,1,2,1,1,1,1,1,1,2,1,0,1,2,1,0,2,2,0,1,

%U 2,0,1,1,1,2,1,0,0,1,2,1,1,1,1,1,1,3,1,2,0,0,2,0,2,1,1,1,2,1,1,1

%N Irregular triangle read by rows: T(n,k) = number of times k appears in n-th row of A342585, n >= 0..

%H Michael De Vlieger, <a href="/A347316/b347316.txt">Table of n, a(n) for n = 0..10295</a> (rows 0 <= n <= 108, flattened)

%e Triangle begins:

%e 1,

%e 1,2,

%e 1,0,3,

%e 1,2,1,1,1,

%e 1,1,0,0,4,

%e 1,2,1,0,1,2,1,

%e ...

%e Row 4 of A342585 is [4, 4, 4, 1, 4, 0], containing one 0, one 1, and four 4's; so row 4 here is [1, 1, 0, 0, 4].

%t Block[{c, k, m, nn = 12}, c[0] = 1; Join[{{1}}, Map[Function[w, {1}~Join~Array[If[ListQ[#], Length[#], 0] &@ Lookup[w, #] &, Max@ Keys[w]]]@ KeySort@ PositionIndex[#] &, SplitBy[Reap[Do[k = 0; While[IntegerQ[c[k]], Set[m, c[k]]; Sow[m]; If[IntegerQ@ c[m], c[m]++, c[m] = 1]; k++]; Sow[0]; c[0]++, nn]][[-1, -1]], # == 0 &][[1 ;; -1 ;; 2]]]] ] // Flatten (* _Michael De Vlieger_, Oct 12 2021 *)

%Y Cf. A342585, A347299 (row sums).

%K nonn,tabf

%O 0,3

%A _N. J. A. Sloane_, Sep 09 2021

%E More terms from _Alois P. Heinz_, Sep 09 2021