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.

A330267 Lexicographically earliest sequence of nonnegative terms such that for any n > 0 and k > 0, a(n+2*k) <> max(a(n), a(n+k)).

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Dec 21 2019

Keywords

Crossrefs

Cf. A003278 (positions of 0's).
See A229037, A268811, A276204, A309890, A317805, A361933, A364057 for similar sequences.
See A330622, A330623 and A330629 for other variants.

Programs

  • C
    See Links section.

Formula

a(n) = 0 iff n belongs to A003278.

A367196 Lexicographically earliest sequence such that for any distinct j, k, m that are the side lengths of a triangle, a(j), a(k), and a(m) are not the side lengths of a triangle.

Original entry on oeis.org

1, 1, 1, 2, 1, 3, 5, 1, 8, 13, 21, 2, 34, 55, 89, 1, 144, 233, 4, 377, 610, 987, 1597, 1, 17, 2584, 4181, 6765, 10946, 17711, 3, 72, 28657, 46368, 75025, 121393, 196418, 317811, 514229, 1, 7, 305, 832040, 1346269, 2178309, 3524578, 41, 5702887, 1292, 9227465
Offset: 1

Views

Author

Neal Gersh Tolunsky, Nov 09 2023

Keywords

Comments

In a triangle, the sum of any two side lengths is greater than that of the third, so that x + y > z. The empty triangle (or line) is not counted, which means that x + y cannot be equal to z. In practice, if we have two side lengths x and y, we can find their sum s and their difference d, which tells us that side z must fall in the range d < z < s to form a triangle.
For n>0, A002620(n+1) gives the number of combinations of three indices whose corresponding terms cannot be the side lengths of a triangle in this sequence.
It appears that the local maxima are the Fibonacci numbers A000045 (except for 1s).
The second-largest values in the log graph, falling roughly on a line, appear to be A001076 (half of the even Fibonacci numbers).
Generalizing the sequence to prohibit the side lengths of any n-gon at distinct n-gonal indices gives A011782.

Examples

			a(3)=1 because the indices 1,2,3 could not be the side lengths of a triangle, so there is no restriction and the smallest number is chosen.
a(7) cannot be 1 because a(3)=1, a(5)=1, and a(7)=1 could be the side lengths of a triangle at indices which are also side lengths of a triangle.
a(7) cannot be 2 because a(4)=2, a(6)=3, and a(7)=2 are side lengths of a triangle at indices that forbid it.
a(7) cannot be 3 because a(5)=1, a(6)=3, and a(7)=3 also make a triangle at indices that forbid it.
a(7) cannot be 4 because a(4)=2, a(6)=3 and a(7)=4 form a triangle at unsuitable indices.
a(7) can be 5 without contradiction, so a(7)=5.
		

Crossrefs

Cf. A316841, A070080 (triangle side lengths).

Programs

  • MATLAB
    See Links.

Extensions

a(11)-a(50) from Samuel Harkness, Nov 13 2023

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

Original entry on oeis.org

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

Views

Author

Neal Gersh Tolunsky, Mar 29 2025

Keywords

Comments

Every subsequence {a(n-2k), a(n-k) a(n)} with its corresponding k value (or index spacing) is unique.

Examples

			To find a(10) = 4, we first try 1. We cannot have a(10) = 1 because this would create the subsequence {1,1,1} at i = 6,8,10, which occurred before at i = 1,3,5. In both cases, k = 2, which is not allowed .
a(10) cannot be 2 because then the subsequence {1,1,2} at i = 2,6,10 would be the same as {1,1,2} at  i = 1,5,9. In both cases, k = 4.
a(10) cannot be 3 because {1,1,3} at i = 6,8,10 would be the same as the subsequence at i = 3,5,7. In both cases, k = 2.
When we try a(10) = 4, we see that none of the new subsequences formed have occurred before with the same k value. Since 4 is a first occurrence, every subsequence created is new, and although i = 6,8,10 has the same subsequence {1,1,4} as i = 2,6,10, the k value is different, which is allowed. So a(10) = 4.
		

Crossrefs

A382502 Lexicographically earliest sequence of positive integers such that no two subsequences {a(j), a(j+k), a(j+2k)} and {a(i), a(i+m), a(i+2m)} with different k and m values are the same.

Original entry on oeis.org

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

Views

Author

Neal Gersh Tolunsky, Mar 29 2025

Keywords

Comments

In other words, each unique subsequence of the form {a(j), a(j+k), a(j+2k)} (j, k >= 1) occurs with only one k value (or index spacing).
Note that a candidate term is sometimes denied because it would create a scenario in which a future term is inevitably the third term in two identical subsequences with different k values. See example.

Examples

			To find a(4), we first try 1. If we allowed a(4) = 1, then the subsequences at i = 1,3,5 and i = 3,4,5 would be the same since they both begin 1,1 and their final index is i=5. Since these two subsequences have distinct k values, they cannot be the same, so a(4) cannot be 1. a(4) = 2 as this creates only one new subsequence, and does not create a scenario where a future value will necessarily contradict the definition.
		

Crossrefs

Programs

  • Python
    from itertools import count
    def A382502_generator():
        a_list = []
        spacings = {} # spacings[t] is the spacing (k) used by the triple t.
        pairs = {} # pairs[i] is a set of pairs (x,y) such that there exist j and k>0 with a(j)=x, a(j+k)=y, and i=j+2k.
        for n in count():
            for a in count(1):
                ok = True
                spacings_new = {}
                for k in range(1,n//2+1):
                    t = a_list[n-2*k],a_list[n-k],a
                    if t in spacings and k != spacings[t] or t in spacings_new:
                        ok = False
                        break
                    spacings_new[t] = k
                if not ok: continue
                pairs_new = []
                for i,a0 in enumerate(reversed(a_list),n+1):
                    p = (a0,a)
                    if i <= 2*(n-1) and p in pairs[i]:
                        ok = False
                        break
                    pairs_new.append(p)
                if ok: break
            yield a
            a_list.append(a)
            spacings.update(spacings_new)
            if n >= 3: del pairs[n+1]
            for i,p in enumerate(pairs_new[1:],n+2):
                if i <= 2*(n-1): pairs[i].add(p)
                else: pairs[i] = {p} # Pontus von Brömssen, Apr 01 2025

Extensions

More terms from Pontus von Brömssen, Mar 30 2025
Showing 1-4 of 4 results.