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

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))

A350103 Triangle read by rows. Number of self-measuring subsets of the initial segment of the natural numbers strictly below n and cardinality k. Number of subsets S of [n] with S = distset(S) and |S| = k.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 3, 1, 1, 1, 1, 4, 2, 1, 1, 1, 1, 5, 2, 1, 1, 1, 1, 1, 6, 3, 2, 1, 1, 1, 1, 1, 7, 3, 2, 1, 1, 1, 1, 1, 1, 8, 4, 2, 2, 1, 1, 1, 1, 1, 1, 9, 4, 3, 2, 1, 1, 1, 1, 1, 1, 1, 10, 5, 3, 2, 2, 1, 1, 1, 1, 1, 1, 1, 11, 5, 3, 2, 2, 1, 1, 1, 1, 1, 1
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

			Triangle starts:
[ 0] [1]
[ 1] [1, 1]
[ 2] [1, 1,  1]
[ 3] [1, 1,  2, 1]
[ 4] [1, 1,  3, 1, 1]
[ 5] [1, 1,  4, 2, 1, 1]
[ 6] [1, 1,  5, 2, 1, 1, 1]
[ 7] [1, 1,  6, 3, 2, 1, 1, 1]
[ 8] [1, 1,  7, 3, 2, 1, 1, 1, 1]
[ 9] [1, 1,  8, 4, 2, 2, 1, 1, 1, 1]
[10] [1, 1,  9, 4, 3, 2, 1, 1, 1, 1, 1]
[11] [1, 1, 10, 5, 3, 2, 2, 1, 1, 1, 1, 1]
[12] [1, 1, 11, 5, 3, 2, 2, 1, 1, 1, 1, 1, 1]
.
The first  column is 1,1,...  because {} = distset({}) and |{}| = 0.
The second column is 1,1,... because {0} = distset({0}) and |{0}| = 1.
The third  column is n-1  because {0, j} = distset({0, j}) and |{0, j}| = 2 for j = 1..n - 1.
The main diagonal is 1,1,... because [n] = distset([n]) and |[n]| = n (these are the complete rulers A103295).
		

Crossrefs

Programs

  • Maple
    T := (n, k) -> ifelse(k < 2, 1, floor((n - 1) / (k - 1))):
    seq(print(seq(T(n, k), k = 0..n)), n = 0..12);
  • Mathematica
    distSet[s_] := Union[Map[Abs[Differences[#][[1]]] &, Union[Sort /@ Tuples[s, 2]]]]; T[n_, k_] := Count[Subsets[Range[0, n - 1]], ?((ds = distSet[#]) == # && Length[ds] == k &)]; Table[T[n, k], {n, 0, 12}, {k, 0, n}] // Flatten (* _Amiram Eldar, Dec 16 2021 *)
  • PARI
    T(n, k) = if(k<=1, 1, (n - 1) \ (k - 1)) \\ Winston de Greef, Jan 31 2024
  • SageMath
    # generating and counting (slow)
    def isSelfMeasuring(R):
        S, L = Set([]), len(R)
        R = Set([r - 1 for r in R])
        for i in range(L):
            for j in (0..i):
                S = S.union(Set([abs(R[i] - R[i - j])]))
        return R == S
    def A349976row(n):
        counter = [0] * (n + 1)
        for S in Subsets(n):
            if isSelfMeasuring(S): counter[len(S)] += 1
        return counter
    for n in range(10): print(A349976row(n))
    

Formula

T(n, k) = floor((n - 1) / (k - 1)) for k >= 2.
T(n, k) = 1 if k = 0 or k = 1 or n >= k >= floor((n + 1)/2).

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).
Showing 1-3 of 3 results.