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-4 of 4 results.

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

Original entry on oeis.org

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, 31, 17, 25, 17, 1, 8, 28, 12, 51, 27, 47, 49, 33, 1, 9, 36, 16, 77, 43, 77, 97, 93, 63, 1, 10, 45, 20, 112, 62, 113, 169, 177, 187, 128
Offset: 0

Views

Author

Peter Luschny, Dec 09 2021

Keywords

Comments

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}.
For instance a subset S of [n] is a complete ruler (A103295) of length n - 1 if and only if distset(S) = [n].

Examples

			Triangle starts:
[n\k]  0, 1,  2,  3,  4,  5,  6,  7,  8,  9
-------------------------------------------
[ 0 ]  1;
[ 1 ]  1, 1;
[ 2 ]  1, 2,  1;
[ 3 ]  1, 3,  3,  1;
[ 4 ]  1, 4,  6,  2,  3;
[ 5 ]  1, 5, 10,  4,  8,  4;
[ 6 ]  1, 6, 15,  6, 17, 10,  9;
[ 7 ]  1, 7, 21,  9, 31, 17, 25, 17;
[ 8 ]  1, 8, 28, 12, 51, 27, 47, 49, 33;
[ 9 ]  1, 9, 36, 16, 77, 43, 77, 97, 93, 63;
.
Let S = {0, 3, 6, 7, 8}. Then S is a subset of [9] and distset(S) = [9].
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}.
		

Crossrefs

Cf. A000079 (row sums), A103295 (main diagonal), A349972 (subdiagonal).

Programs

  • Mathematica
    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 *)
  • SageMath
    from collections import Counter
    def DistsetLength(R) :
        S, L = Set([]), len(R)
        for r in R:
            for s in R:
                S = S.union(Set([abs(r - s)]))
        return len(S)
    def A349976row(n):
        C = Counter(DistsetLength(s) for s in Subsets(n))
        return [C[k] for k in (0..n)]
    for n in (0..9): print(A349976row(n))

A350102 Number of self-measuring subsets of the initial segment of the natural numbers strictly below n. Number of subsets S of [n] with S = distset(S).

Original entry on oeis.org

1, 2, 3, 5, 7, 10, 12, 16, 18, 22, 25, 29, 31, 37, 39, 43, 47, 52, 54, 60, 62, 68, 72, 76, 78, 86, 89, 93, 97, 103, 105, 113, 115, 121, 125, 129, 133, 142, 144, 148, 152, 160, 162, 170, 172, 178, 184, 188, 190, 200, 203, 209, 213, 219, 221, 229, 233, 241, 245
Offset: 0

Views

Author

Peter Luschny, Dec 14 2021

Keywords

Comments

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}. We call a subset S of the natural numbers self-measuring if and only if S = distset(S).

Examples

			a(0) = 1 = card({}).
a(4) = 7 = card({}, {0}, {0, 1}, {0, 2}, {0, 3}, {0, 1, 2}, {0, 1, 2, 3}).
a(6) = 12 = card({}, {0}, {0, 1}, {0, 2}, {0, 3}, {0, 4}, {0, 5}, {0, 1, 2}, {0, 2, 4}, {0, 1, 2, 3}, {0, 1, 2, 3, 4}, {0, 1, 2, 3, 4, 5}).
		

Crossrefs

Programs

  • Maple
    A350102 := n -> ifelse(n = 0, 1, 2 + add(iquo(n-1, k), k = 1 .. n-1)):
    seq(A350102(n), n = 0 .. 58);
  • Mathematica
    a[0] = 1; a[1] = 2; a[n_] := a[n] = a[n - 1] + DivisorSigma[0, n - 1];
    Table[a[n], {n, 0, 58}]

Formula

a(n) = a(n - 1) + tau(n - 1) for n >= 2, tau = A000005.
a(n) = 2 + Sum_{k=1..n-1} floor((n - 1)/k) for n >= 1.
a(n) = 2 + A006218(n - 1) for n >= 1.
a(n) = 1 + A054519(n - 1) for n >= 1.
Row sums of A350103.
a(n) >= n + floor(n/2) + floor(n/3).

A350105 Number of subsets of the initial segment of the natural numbers strictly below n which are not self-measuring. Number of subsets S of [n] with S != distset(S).

Original entry on oeis.org

0, 0, 1, 3, 9, 22, 52, 112, 238, 490, 999, 2019, 4065, 8155, 16345, 32725, 65489, 131020, 262090, 524228, 1048514, 2097084, 4194232, 8388532, 16777138, 33554346, 67108775, 134217635, 268435359, 536870809, 1073741719, 2147483535, 4294967181, 8589934471, 17179869059
Offset: 0

Views

Author

Peter Luschny, Dec 16 2021

Keywords

Comments

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}. We call a subset S of the natural numbers self-measuring if and only if S = distset(S).

Crossrefs

Programs

  • SageMath
    def A350105List(len):
        L = [0] * len
        b, z = 2, 2
        for n in (2..len-1):
            b += sloane.A000005(n - 1)
            z += z
            L[n] = z - b
        return L
    print(A350105List(35))

Formula

See the formulas in A350102.
a(n) = 2^n - A350102(n).

A350104 a(n) = Sum_{k=0..n} A350102(k).

Original entry on oeis.org

1, 3, 6, 11, 18, 28, 40, 56, 74, 96, 121, 150, 181, 218, 257, 300, 347, 399, 453, 513, 575, 643, 715, 791, 869, 955, 1044, 1137, 1234, 1337, 1442, 1555, 1670, 1791, 1916, 2045, 2178, 2320, 2464, 2612, 2764, 2924, 3086, 3256, 3428, 3606, 3790, 3978, 4168, 4368
Offset: 0

Views

Author

Peter Luschny, Dec 16 2021

Keywords

Crossrefs

Programs

  • SageMath
    def A350104List(len):
        L = [1] * len
        a, b = 1, 2
        for n in (2..len):
            a += b
            b += sloane.A000005(n - 1)
            L[n - 1] = a
        return L
    print(A350104List(50))
Showing 1-4 of 4 results.