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.

A381597 Lexicographically earliest sequence of positive integers such that for any t and k, with k>=1, where t = a(n) = a(n+k) = a(n+2*k), only one occurrence of k, for a given t, appears anywhere in the sequence.

Original entry on oeis.org

1, 1, 1, 2, 1, 1, 2, 1, 2, 2, 2, 1, 1, 2, 1, 1, 3, 2, 3, 2, 1, 3, 1, 2, 3, 2, 2, 1, 3, 3, 2, 1, 2, 3, 3, 3, 1, 1, 4, 1, 2, 3, 4, 3, 1, 3, 1, 4, 4, 2, 3, 2, 2, 4, 3, 4, 2, 4, 4, 2, 1, 4, 1, 3, 2, 2, 4, 5, 3, 1, 3, 3, 1, 4, 4, 2, 4, 4, 3, 1, 1, 2, 3, 3, 2, 5, 5, 3, 5, 2, 1, 3, 4, 5, 4, 1, 5, 4, 3, 1, 2, 4, 1, 4, 1, 5, 2, 2, 3, 3, 5, 5, 5, 4, 5, 1, 4, 3, 2, 5
Offset: 1

Views

Author

Scott R. Shannon, Mar 01 2025

Keywords

Comments

See A381599 for the index where n first appears, and A381598 for the index where three consecutive n's appears.

Examples

			a(1) = a(2) = a(3) = 1, which is the first appearance of three 1's separated by one term.
a(4) = 2 as 1 cannot be chosen as that would form a(2) = a(3) = a(4) = 1, but three 1's separated by one term has already appeared.
a(5) = 1, which also forms three 1's separated by two terms, a(1) = a(3) = a(5) = 1.
a(17) = 3 as 1 cannot be chosen as that would form a(15) = a(16) = a(17) = 1, but three 1's separated by one term has already appeared, while choosing 2 would form a(11) = a(14) = a(17) = 2, but three 2's separated by three terms has already appeared at a(4) = a(7) = a(10) = 2.
		

Crossrefs

Cf. A381598 (triplets), A381599 (where n first appears), A370708 (indices where 1's appear), A281511, A229037.

A370577 Lexicographically earliest sequence such that for any value m, the number of distinct values between a pair of consecutive m's is distinct.

Original entry on oeis.org

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

Views

Author

Neal Gersh Tolunsky, Feb 22 2024

Keywords

Examples

			The first terms with the number of distinct values enclosed by m = 1..4 below:
   n|  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
...
a(n)|  1  1  2  1  2  2  3  1  2  3  3  4  1  2  3  4  3  4  4  5  1  2  3
...
----+---------------------------------------------------------------------
 1's|     0,    1,          2,             3,                      4,
...
 2's|              1, 0,       2,             3,                      4,
...
 3's|                             2, 0,          3,    1,                4,
...
 4's|                                               3,    1, 0,
...
		

Crossrefs

Programs

  • Python
    from itertools import islice
    def agen(): # generator of terms
        e, a = set(), []
        while True:
            an, allnew = 0, False
            while not allnew:
                allnew, an, nd = True, an+1, None
                for i in range(len(a)-1, -1, -1):
                    if an == a[i]:
                        nd = len(set(a[i+1:]))
                        if (an, nd) in e: allnew = False
                        break
            yield an; a.append(an); e.add((an, nd))
    print(list(islice(agen(), 86))) # Michael S. Branicky, Feb 22 2024

Extensions

More terms from Michael S. Branicky, Feb 22 2024

A381598 Index of first term of three consecutive n's in A381597.

Original entry on oeis.org

1, 9, 34, 147, 111, 359, 437, 389, 594, 826, 1102, 83317, 1789, 5142, 2931, 12671
Offset: 1

Views

Author

Scott R. Shannon, Mar 01 2025

Keywords

Comments

The terms vary greatly in size - after 5.2 million terms of A381597 no three consecutive 17's or 18's have appeared, although three consecutive 19's appear at index 6474. The largest known term is a(192) = 5135798.

Crossrefs

A381599 Index where n first appears in A381597.

Original entry on oeis.org

1, 4, 17, 39, 68, 124, 191, 286, 441, 577, 776, 1043, 1192, 1556, 1736, 2214, 2744, 3221, 3519, 4248, 5028, 5542, 6574, 7013, 8093, 8945, 10110, 11043, 12413, 13223, 14476, 15923, 17430, 18617, 20027, 21991, 24016, 25364, 27414, 29356, 31392, 32614, 35743, 37888, 40301, 42620, 45696, 47776, 51109, 53264, 56429, 58471, 61676, 64468, 69437, 72011, 75626
Offset: 1

Views

Author

Scott R. Shannon, Mar 01 2025

Keywords

Crossrefs

A379381 a(1)=1, a(2)=2; thereafter, a(n) is the smallest positive integer such that for any value k, the number of distinct values between a pair of k's is distinct, counting k itself.

Original entry on oeis.org

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

Views

Author

Neal Gersh Tolunsky, Dec 21 2024

Keywords

Comments

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

Examples

			a(7)=4: We cannot have a(7)=1 here because this would make a(1..7) = 1, 2, 1, 2, 3, 3, 1 enclose the same number of terms as a(3..7) = 1, 2, 3, 3, 1 (3 distinct values). We cannot have a(7)=2 because this would mean a(4..7) = 2, 3, 3, 2 encloses 2 values, which we had at a(2..4) = 2, 1, 2. a(7) cannot be 3 because this would repeat a(5-6) = 3, 3 with a(6-7) = 3, 3, again enclosing 1 distinct value. So a(7) = 4 without restriction.
		

Crossrefs

Showing 1-5 of 5 results.