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.

A331332 Sparse ruler statistics: T(n,k) (0 <= k <= n) is the number of rulers with length n where the length of the first segment appears k times. Triangle read by rows.

This page as a plain text file.
%I A331332 #32 Nov 08 2020 04:26:36
%S A331332 1,0,1,0,1,1,0,3,0,1,0,4,3,0,1,0,8,4,3,0,1,0,14,9,4,4,0,1,0,26,16,12,
%T A331332 4,5,0,1,0,46,34,21,15,5,6,0,1,0,85,64,45,28,20,6,7,0,1,0,155,124,90,
%U A331332 64,36,27,7,8,0,1,0,286,236,183,128,90,48,35,8,9,0,1,0,528,452,361,269,185,126,63,44,9,10,0,1
%N A331332 Sparse ruler statistics: T(n,k) (0 <= k <= n) is the number of rulers with length n where the length of the first segment appears k times. Triangle read by rows.
%C A331332 A sparse ruler, or simply a ruler, is a strict increasing finite sequence of nonnegative integers starting from 0 called marks. See A103294 for more definitions.
%H A331332 Alois P. Heinz, <a href="/A331332/b331332.txt">Rows n = 0..200, flattened</a>
%F A331332 Sum_{k=1..n} k * T(n,k) = A175656(n-1) for n>0. - _Alois P. Heinz_, Feb 07 2020
%e A331332 Triangle starts:
%e A331332 [ 0][1]
%e A331332 [ 1][0,   1]
%e A331332 [ 2][0,   1,   1]
%e A331332 [ 3][0,   3,   0,  1]
%e A331332 [ 4][0,   4,   3,  0,  1]
%e A331332 [ 5][0,   8,   4,  3,  0,  1]
%e A331332 [ 6][0,  14,   9,  4,  4,  0,  1]
%e A331332 [ 7][0,  26,  16, 12,  4,  5,  0, 1]
%e A331332 [ 8][0,  46,  34, 21, 15,  5,  6, 0, 1]
%e A331332 [ 9][0,  85,  64, 45, 28, 20,  6, 7, 0, 1]
%e A331332 [10][0, 155, 124, 90, 64, 36, 27, 7, 8, 0, 1]
%p A331332 b:= proc(n, i) option remember; `if`(n=0, x, add(expand(
%p A331332      `if`(i=j, x, 1)*b(n-j, `if`(n<i+j, 0, i))), j=1..n))
%p A331332     end:
%p A331332 T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(
%p A331332             `if`(n=0, 1, add(b(n-j, j), j=1..n))):
%p A331332 seq(T(n), n=0..12);  # _Alois P. Heinz_, Feb 06 2020
%t A331332 b[n_, i_] := b[n, i] = If[n == 0, x, Sum[Expand[If[i == j, x, 1] b[n - j, If[n < i + j, 0, i]]], {j, 1, n}]];
%t A331332 T[n_] := Function[p, Table[Coefficient[p, x, i], {i, 0, Exponent[p, x]}]][ If[n == 0, 1, Sum[b[n - j, j], {j, 1, n}]]];
%t A331332 T /@ Range[0, 12] // Flatten (* _Jean-François Alcover_, Nov 08 2020, after _Alois P. Heinz_ *)
%o A331332 (SageMath)
%o A331332 def A331332_row(n):
%o A331332     if n == 0: return [1]
%o A331332     L = [0 for k in (0..n)]
%o A331332     for c in Compositions(n):
%o A331332         L[list(c).count(c[0])] += 1
%o A331332     return L
%o A331332 for n in (0..10): print(A331332_row(n))
%Y A331332 Columns k=0-1 give: A000007, A331330.
%Y A331332 Row sums give A011782.
%Y A331332 Row sums over even columns give A331609 (for n>0).
%Y A331332 Row sums over odd columns give A331606 (for n>0).
%Y A331332 T(2n,n) gives A332051.
%Y A331332 Cf. A103294, A175656.
%K A331332 nonn,tabl
%O A331332 0,8
%A A331332 _Peter Luschny_, Jan 24 2020