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

A366631 Lexicographically earliest sequence such that each set of numbers enclosed by a pair of equal terms, excluding the endpoints, is distinct.

Original entry on oeis.org

1, 1, 2, 1, 2, 3, 2, 4, 2, 3, 4, 5, 3, 6, 3, 5, 6, 7, 3, 8, 4, 5, 7, 8, 7, 8, 9, 4, 7, 9, 10, 4, 9, 10, 11, 4, 10, 12, 4, 11, 13, 4, 12, 13, 12, 13, 14, 4, 15, 4, 14, 15, 16, 4, 17, 6, 8, 10, 14, 16, 17, 16, 17, 18, 9, 15, 17, 18, 19, 11, 16, 19, 20, 18, 19
Offset: 1

Views

Author

Neal Gersh Tolunsky, Oct 14 2023

Keywords

Comments

The word 'set' means that every element is unique and order is irrelevant. {2,3}, for example, is equivalent to {3,2,2} and thus both could never appear in the sequence.
Two consecutive equal values enclose the empty set {}, and thus after [a(1), a(2)] = [1, 1] no consecutive equal values will occur again.
Note that we are considering sets between every pair of equal values, not just those that appear consecutively. For example, [2,1,2,3,2] encloses a set, which is {1,2,3}, as well as [2,3,2], which encloses {3}.
It appears that for n >= 21510, a(n + 17796) = a(n) + 2614 (found by Rémy Sigrist). If this linear recurrence is true, every number appears finitely many times.
A value k is banned after all the values in a set enclosed by a(i1) = a(i2) = k, with i1 < i2, and k itself have reoccurred in the sequence after a(i2). Suppose, for example, after the set S1 enclosed by a(i1) and a(i2) every element in S1 has appeared and also a(i3) = k, and then we had a(i4) = k. Then we would have a new set S2 enclosed by a(i2) and a(i4) that is a superset of S1 U {k}. This would contradict the sequence's definition since the set S2 enclosed by a(i2) and a(i4) is identical to the set S3 enclosed by a(i1) and a(i4) because S1 U {a(i2)} adds no new elements.
Assuming the linear recurrence above is true, the number 526 occurs a record number of 44 times in the sequence and it does not occur again after the linear recurrence begins. The same is true of three other values which occur 41, 42, and 43 times in the sequence.
For n > 2, a new value is always followed by the smallest number that has not yet been banned and is distinct from the previous number (i.e. does not form a null set).
If the definition is changed so that endpoints are included, this becomes A008619.

Examples

			a(2)=1, establishing the empty set, [1,1] -> {}.
a(4)=1, creating the sets [1,2,1] -> {2} and [1,1,2,1] -> {1,2}, which are distinct from any set that has appeared thus far. Note that 1 is now permanently banned since the next 1 would have to enclose the same set with a(1) as it would with a(2).
a(8)=4: a(8) cannot be 1 since 1 has been banned. 2 would form the empty set with a(7)=2. a(8) cannot be 3 since this would form the set [3,2,3] -> {2}, which already occurred as [1,2,1] -> {2}. a(8)=4 because 4 is a first occurrence and thus forms no sets.
For another example of a banned number, see the last occurrence of 2, which is a(9)=2. a(10) cannot be 2 since this would form the empty set. At a(11), the value 2 is banned forever since any further 2 would form the same set of numbers with a(7)=2 as with a(5)=2. This is because a later term paired with a(5)=2 would only add the values a(7)=2 and a(6)=3, in comparison to a pairing with a(7)=2, which already encloses a(9)=2 and a(10)=3.
		

Crossrefs

Programs

  • PARI
    See Links section.
    
  • Python
    from itertools import islice
    def agen(): # generator of terms
        m, a = set(), []
        while True:
            an, allnew = 0, False
            while not allnew:
                allnew, an, mn = True, an+1, set()
                for i in range(len(a)):
                    if an == a[i]:
                        t = tuple(sorted(set(a[i+1:])))
                        if t in m or t in mn: allnew = False; break
                        mn.add(t)
            yield an; a.append(an); m |= mn
    print(list(islice(agen(), 75))) # Michael S. Branicky, Jan 15 2024

Extensions

More terms from Rémy Sigrist, Oct 15 2023
Edited by Peter Munn, Dec 05 2023

A366625 Lexicographically earliest sequence of positive integers such that each multiset enclosed by two equal terms, excluding the endpoints, is distinct.

Original entry on oeis.org

1, 1, 2, 1, 2, 3, 1, 2, 4, 1, 2, 3, 2, 1, 5, 1, 2, 3, 4, 1, 2, 3, 4, 2, 1, 5, 3, 1, 2, 4, 2, 1, 5, 3, 4, 1, 2, 6, 1, 2, 3, 4, 5, 1, 2, 4, 3, 7, 1, 2, 3, 4, 5, 3, 1, 2, 6, 2, 1, 3, 4, 5, 7, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 7, 2, 1, 3, 4, 5, 6, 1, 2, 4, 3, 5, 8, 1
Offset: 1

Views

Author

Samuel Harkness, Oct 14 2023

Keywords

Comments

Every positive integer occurs infinitely many times in the sequence.
The multiset between any two equal terms is unique. For example: once consecutive values "A B C A" occur, both "D B C D" and "D C B D" can never occur, because the multiset "B C" would be repeated between equal terms.
Two consecutive values enclose the empty multiset. For this reason, after [a(1), a(2)] = [1, 1], no consecutive equal values will occur again.
A new value is always followed by 1.
The sequence first differs from A366624 at a(15).

Examples

			a(15) = 5: a(15) cannot be 1 since this would form the empty multiset with a(14) = 1. a(15) cannot be 2 because this would form the multiset [2 1 2] = {1}, which already occurred at [2 1 2] = {1}. a(15) cannot be 3 because this would form the multiset [3 2 1 3] = {1, 2}, which already occurred at [1 1 2 1] = {1, 2}. a(15) cannot be 4 because this would form the multiset [4 1 2 3 2 1 4] = {1, 1, 2, 2, 3}, which already occurred at [1 1 2 1 2 3 1] = {1, 1, 2, 2, 3}. a(15) = 5 because 5 is a first occurrence and thus creates no new multisets.
For this sequence, the multisets between k and all other occurrences of k must be checked. The first instance such that this is the sole reason for restricting a possible value is when considering 2 for a(27).
a(27) != 2 since 2 there would cause two enclosed multisets with the same 5 terms (in different order, which doesn't matter for a multiset),
  n    =   15      19    22      26 27
  a(n) =  1 5 1 2 3 4 1 2 3 4 2 1 5 [2]
            |-------|     |-------|
There are also instances where overlapping conflicting regions are the sole reason for restricting a possible value.
a(74) != 5 since 5 there would cause two enclosed multisets with the same 20 terms,
  n    =  38                              54
  a(n) = 2 6 1 2 3 4 5 1 2 4 3 7 1 2 3 4 5 3 1
           |----------------------------------
                                           |--
  n    =  57                              73
  a(n) = 2 6 2 1 3 4 5 7 1 2 3 4 5 6 1 2 3 4[5]
         --|
         ----------------------------------|
		

Crossrefs

Programs

  • MATLAB
    See Links section.
    
  • Python
    from itertools import islice
    def agen(): # generator of terms
        m, a = set(), []
        while True:
            an, allnew = 0, False
            while not allnew:
                allnew, an, mn = True, an+1, set()
                for i in range(len(a)):
                    if an == a[i]:
                        t = tuple(sorted(a[i+1:]))
                        if t in m or t in mn: allnew = False; break
                        mn.add(t)
            yield an; a.append(an); m |= mn
    print(list(islice(agen(), 87))) # Michael S. Branicky, Oct 25 2023

A364057 Lexicographically earliest infinite sequence of positive integers such that every subsequence {a(j), a(j+k), a(j+2k)} (j, k >= 1) is unique.

Original entry on oeis.org

1, 1, 1, 2, 3, 1, 2, 4, 5, 6, 7, 8, 5, 1, 2, 9, 3, 4, 6, 7, 1, 10, 11, 12, 13, 8, 14, 15, 16, 3, 17, 9, 18, 4, 7, 19, 5, 2, 11, 12, 20, 6, 1, 8, 21, 22, 9, 23, 24, 13, 14, 3, 10, 16, 17, 25, 26, 19, 27, 6, 28, 11, 15, 20, 22, 29, 12, 21, 16, 23, 30, 18, 31, 32
Offset: 1

Views

Author

Samuel Harkness, Oct 19 2023

Keywords

Comments

To find a(n), two criteria must be satisfied:
1. Every subsequence {a(n-2k), a(n-k) a(n)} created by a(n) must be unique.
2. a(n) cannot create the scenario where a future a(m) will create multiple {a(m-2k), a(m-k), a(m)} regardless of choice for a(m). The first time this is the sole reason a candidate is denied is at a(10), see Example below.
Will every subsequence of 3 positive integers appear in arithmetic progression in this sequence?
Will every positive integer occur infinitely many times?
For n >= 3, a(n) != a(n+1).
In the 74 initially published terms, numbers on average seem to reoccur at (very) roughly twice the index of their previous occurrence. This seems worthy of better quantification when further terms are established. - Peter Munn, Nov 03 2023

Examples

			For a(9), we first try 1. If a(9) were 1, {a(3), a(6), a(9)} would be {1, 1, 1}, but this already occurred at {a(1), a(2), a(3)}.
Next, try 2. If a(9) were 2, {a(3), a(6), a(9)} would be {1, 1, 2}, but this already occurred at {a(2), a(3), a(4)}.
Next, try 3. If a(9) were 3, {a(3), a(6), a(9)} would be {1, 1, 3}, but this already occurred at {a(1), a(3), a(5)}.
Next, try 4. If a(9) were 4, {a(1), a(5), a(9)} would be {1, 3, 4}, but this already occurred at {a(2), a(5), a(8)}.
Then, try 5. New subsequences at indices {a(1), a(5), a(9)} = {1, 3, 5}, {a(3), a(6), a(9)} = {1, 1, 5}, {a(5), a(7), a(9)} = {3, 2, 5}, and {a(7), a(8), a(9)} = {2, 4, 5} are formed, none of which have occurred at any {a(j), a(j+k), a(j+2k)} (for any j and k) previously. No 5 has occurred previously, so criteria (2) in Comments must be satisfied. Thus a(9) = 5.
a(10) is the first time a candidate is denied solely because it would create a guaranteed future duplicate. Note that no subsequences prevent a(10) from being 4.
n    = 1  2  3  4  5  6  7  8  9 10 11 12 13 14
a(n) = 1  1  1  2  3  1  2  4  5 [4]          X
                      |           |           |
          |                 |                 |
If a(10) were 4, {a(2), a(8), a(14)} = {a(6), a(10), a(14)} = {1, 4, X}, making a subsequence {a(j), a(j+k), a(j+2k)} which is not unique. Therefore a(10) != 4.
		

Crossrefs

Programs

  • MATLAB
    See Links section.
    (C++) See Links section.

A370264 Lexicographically earliest sequence such that each subsequence enclosed by a pair of equal values, including the endpoints, has a unique sum.

Original entry on oeis.org

1, 1, 2, 1, 3, 2, 1, 3, 3, 4, 2, 1, 3, 5, 4, 2, 6, 7, 1, 3, 5, 4, 7, 6, 2, 8, 1, 5, 6, 9, 9, 3, 1, 10, 2, 8, 4, 1, 10, 6, 9, 3, 2, 5, 11, 12, 4, 3, 10, 7, 8, 2, 13, 11, 12, 4, 13, 1, 14, 3, 9, 15, 5, 6, 7, 14, 16, 6, 2, 4, 8, 12, 3, 9, 10, 11, 5, 7, 13, 1, 14
Offset: 1

Views

Author

Neal Gersh Tolunsky, Feb 13 2024

Keywords

Comments

Note that we are considering the sums of the terms between every pair of equal values, not just those that appear consecutively.

Examples

			a(2)=1 creates the pair [a(1), a(2)] = [1, 1], which gives the unique sum of 2.
a(4)=1 creates two unique sums: [1,2,1] = sum of 4 and [1,1,2,1] = sum of 5.
a(8)=3 creates one unique sum: [3,2,1,3] = sum of 9.
		

Crossrefs

Cf. A370264 (excluding endpoints), A366493, A366624, A366631, A366625.

Programs

  • Python
    from itertools import islice
    def agen(): # generator of terms
        s, a = set(), []
        while True:
            an, allnew = 0, False
            while not allnew:
                allnew, an, sn = True, an+1, set()
                for i in range(len(a)):
                    if an == a[i]:
                        t = sum(a[i+1:]) + 2*an
                        if t in s or t in sn: allnew = False; break
                        sn.add(t)
            yield an; a.append(an); s |= sn
    print(list(islice(agen(), 81))) # Michael S. Branicky, Feb 14 2024

Extensions

a(16) and beyond from Michael S. Branicky, Feb 14 2024

A370263 Lexicographically earliest sequence such that each subsequence enclosed by a pair of equal values, excluding the endpoints, has a unique sum.

Original entry on oeis.org

1, 1, 2, 1, 2, 3, 1, 2, 4, 1, 5, 3, 6, 1, 2, 4, 7, 2, 3, 5, 6, 4, 5, 7, 8, 1, 3, 5, 2, 6, 4, 9, 10, 7, 1, 3, 8, 11, 4, 2, 8, 9, 12, 1, 3, 6, 4, 7, 11, 10, 2, 5, 8, 13, 14, 2, 9, 15, 7, 1, 3, 4, 11, 13, 12, 16, 1, 5, 14, 6, 8, 10, 9, 4, 17, 2, 10, 3, 18, 11, 16
Offset: 1

Views

Author

Neal Gersh Tolunsky, Feb 13 2024

Keywords

Comments

Two consecutive equal values enclose no terms, which have a sum of 0, and thus after [a(1), a(2)] = [1, 1] no consecutive equal values will occur again.
Note that we are considering the sums of the terms between every pair of equal values, not just those that appear consecutively.

Examples

			a(2)=1 creates the pair [a(1), a(2)] = [1, 1], which gives the unique sum of 0.
a(4)=1 creates two unique sums: [1,2,1] -> [2] = sum of 2 and [1,1,2,1] -> [1,2] = sum of 3.
a(8)=2 creates two unique sums: [2,3,1,2] -> [3,1] = sum of 4 and [2,1,2,3,1,2] -> [1,2,3,1] = sum of 7.
		

Crossrefs

Cf. A370264 (including endpoints), A366624, A366493, A366631, A366625.

Programs

  • Python
    from itertools import islice
    def agen(): # generator of terms
        s, a = set(), []
        while True:
            an, allnew = 0, False
            while not allnew:
                allnew, an, sn = True, an+1, set()
                for i in range(len(a)):
                    if an == a[i]:
                        t = sum(a[i+1:])
                        if t in s or t in sn: allnew = False; break
                        sn.add(t)
            yield an; a.append(an); s |= sn
    print(list(islice(agen(), 81))) # Michael S. Branicky, Feb 14 2024

Extensions

a(16) and beyond from Michael S. Branicky, Feb 14 2024
Showing 1-5 of 5 results.