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.

A349976 Triangle read by rows, number of subsets S of [n] with |distset(S)| = k. T(n, k) for 0 <= k <= n.

This page as a plain text file.
%I A349976 #39 Apr 30 2022 20:10:11
%S A349976 1,1,1,1,2,1,1,3,3,1,1,4,6,2,3,1,5,10,4,8,4,1,6,15,6,17,10,9,1,7,21,9,
%T A349976 31,17,25,17,1,8,28,12,51,27,47,49,33,1,9,36,16,77,43,77,97,93,63,1,
%U A349976 10,45,20,112,62,113,169,177,187,128
%N A349976 Triangle read by rows, number of subsets S of [n] with |distset(S)| = k. T(n, k) for 0 <= k <= n.
%C A349976 We use the notation [n] = {0, 1, ..., n-1}. If S is a subset of [n] then we define the distset of S (set of distances of S) as {|x - y|: x, y in S}.
%C A349976 For instance a subset S of [n] is a complete ruler (A103295) of length n - 1 if and only if distset(S) = [n].
%H A349976 Fausto A. C. Cariboni, <a href="/A349976/b349976.txt">Rows n = 0..47, flattened</a> (rows n = 0..36 from Peter Luschny)
%H A349976 Scott Harvey-Arnold, Steven J. Miller, and Fei Peng, <a href="https://arxiv.org/abs/2001.08931">Distribution of missing differences in diffsets</a>, arXiv:2001.08931 [math.CO], 2020. Also in: Combinatorial and Additive Number Theory IV, Springer 2021. [Table 2 and Table 3, page 276 and 277 in the book.]
%H A349976 Peter Luschny, <a href="/A349976/a349976.txt">The first 37 rows, formatted as a triangular array.</a>
%H A349976 <a href="/index/Per#perul">Index entries for sequences related to perfect rulers.</a>
%e A349976 Triangle starts:
%e A349976 [n\k]  0, 1,  2,  3,  4,  5,  6,  7,  8,  9
%e A349976 -------------------------------------------
%e A349976 [ 0 ]  1;
%e A349976 [ 1 ]  1, 1;
%e A349976 [ 2 ]  1, 2,  1;
%e A349976 [ 3 ]  1, 3,  3,  1;
%e A349976 [ 4 ]  1, 4,  6,  2,  3;
%e A349976 [ 5 ]  1, 5, 10,  4,  8,  4;
%e A349976 [ 6 ]  1, 6, 15,  6, 17, 10,  9;
%e A349976 [ 7 ]  1, 7, 21,  9, 31, 17, 25, 17;
%e A349976 [ 8 ]  1, 8, 28, 12, 51, 27, 47, 49, 33;
%e A349976 [ 9 ]  1, 9, 36, 16, 77, 43, 77, 97, 93, 63;
%e A349976 .
%e A349976 Let S = {0, 3, 6, 7, 8}. Then S is a subset of [9] and distset(S) = [9].
%e A349976 For n = 7 the 9 subsets S with |distset(S)| = 3 are: {1, 2, 3}, {1, 3, 5}, {1, 4, 7}, {2, 3, 4}, {2, 4, 6}, {3, 4, 5}, {3, 5, 7}, {4, 5, 6}, {5, 6, 7}.
%t A349976 distSetSize[s_] := Length @ Union[Map[Abs[Differences[#][[1]]] &, Union[Sort /@ Tuples[s, 2]]]]; T[n_, k_] := Count[Subsets[Range[0, n - 1]], _?(distSetSize[#] == k &)]; Table[T[n, k], {n, 0, 10}, {k, 0, n}] // Flatten (* _Amiram Eldar_, Dec 12 2021 *)
%o A349976 (SageMath)
%o A349976 from collections import Counter
%o A349976 def DistsetLength(R) :
%o A349976     S, L = Set([]), len(R)
%o A349976     for r in R:
%o A349976         for s in R:
%o A349976             S = S.union(Set([abs(r - s)]))
%o A349976     return len(S)
%o A349976 def A349976row(n):
%o A349976     C = Counter(DistsetLength(s) for s in Subsets(n))
%o A349976     return [C[k] for k in (0..n)]
%o A349976 for n in (0..9): print(A349976row(n))
%Y A349976 Columns: A000012, A000027, A000217, A002620, A349975.
%Y A349976 Cf. A000079 (row sums), A103295 (main diagonal), A349972 (subdiagonal).
%Y A349976 Cf A349973, A349974, A350103.
%K A349976 nonn,tabl,hard
%O A349976 0,5
%A A349976 _Peter Luschny_, Dec 09 2021