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.

User: Neal Gersh Tolunsky

Neal Gersh Tolunsky's wiki page.

Neal Gersh Tolunsky has authored 128 sequences. Here are the ten most recent ones:

A384450 a(1) = 0; thereafter, a(n) is the number of arithmetic progressions of length 3 or greater at indices in an arithmetic progression ending at a(n-1).

Original entry on oeis.org

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

Author

Neal Gersh Tolunsky, May 27 2025

Keywords

Comments

In other words, take the longest arithmetic progression at indices with common difference k ending at a(n-1) and call that length j. a(n) is the sum of each j-2 that corresponds to a distinct common difference k. This means that an arithmetic progression of length 3 is worth 1 point, length 4 is worth 2 points, and so on.

Examples

			To find a(10), we see that there are 4 arithmetic progressions ending in a(9) = 0. These occur at indices i = 5,7,9; i = 3,5,7,9; i = 1,3,5,7,9; and i = 1,5,9. So a(10) = 4.
		

Crossrefs

Extensions

a(32)-a(86) from Pontus von Brömssen, May 30 2025

A383421 a(1)=1; thereafter if a(n-1) is a first occurrence, then a(n) is the number of values that occur exactly once in the sequence thus far. Otherwise; a(n) is the number of terms that are the same distance away from an earlier equal value as a(n-1) is from its previous last occurrence.

Original entry on oeis.org

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

Author

Neal Gersh Tolunsky, Apr 26 2025

Keywords

Examples

			a(18) = 3: a(17) = 1 has a distance of 5 from its previous last occurrence a(12) = 1. There are a total of 3 terms with a distance of 5 from an earlier equal term; they occur at indices i = 8,9,17. So a(18) = 3.
		

Crossrefs

A383340 a(1)=1; thereafter if a(n-1) is a first occurrence, then a(n) is the number of first occurrences in the sequence thus far. Otherwise, a(n) is the number of terms that are the same number of distinct values away from their previous last occurrence as a(n-1).

Original entry on oeis.org

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

Author

Neal Gersh Tolunsky, Apr 23 2025

Keywords

Examples

			a(17) = 3: a(16) = 2 is separated by 2 distinct values from its previous last occurrence. There are 3 terms in total separated by two distinct values from their previous last occurrence; they are at indices i = 8,9,16. So a(17) = 3.
		

Crossrefs

Cf. A383339.

A383339 a(1)=1; thereafter if a(n-1) is a first occurrence, then a(n) is the number of first occurrences in the sequence thus far. Otherwise; a(n) is the number of terms that are the same distance away from their previous last occurrence as a(n-1).

Original entry on oeis.org

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

Author

Neal Gersh Tolunsky, Apr 23 2025

Keywords

Comments

Alternatively, a(n) is the number of terms with the same Backwards van Eck transform as a(n-1).

Examples

			a(14) = 5: a(13) = 2 has a distance of 1 from its previous last occurrence a(12) = 2. There are 5 terms in total with a distance of 1 from their previous last occurrence; they are at indices i = 2,3,6,10,13. So a(14) = 5.
		

Crossrefs

A382911 Lexicographically earliest sequence of positive integers such that the n-th pair of consecutive equal values are separated by a(n) distinct terms, with pairs numbered according to the average index of the pair.

Original entry on oeis.org

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

Author

Neal Gersh Tolunsky, Apr 08 2025

Keywords

Comments

If two pairs have the same midpoint, the pair enclosing a longer subsequence is considered first (in other words, the pair with the earlier first term and later second term).
Calculating terms may require backtracking, since pair numbers are not fixed until enough later terms either do or don't pair with earlier terms.

Examples

			The 1st pair (1,2,1) has average index 2 and encloses a(1) = 1 terms.
The 2nd pair (2,1,3,1,2) has average index 4 and encloses a(2) = 2 distinct terms.
The 4th pair (3,1,2,4,2,3) has average index 6.5 and encloses a(4) = 3 distinct terms.
The 5th pair (2,4,2) has average index 7 and encloses a(5) = 1 term.
Notice how the 2nd term of the 5th pair a(8) = 2 occurs earlier than the 2nd term of the 4th pair a(9) = 3. Because the average index (or center of the subsequence) is earlier in the case of the pair enclosing a(4) = 3 terms, we consider it earlier than the pair enclosing a(5) = 1 terms. If after setting a(8) = 2 enclosing a(5) = 1 terms we had not been able to find a value to create a pair with an earlier average index to enclose a(4) = 3 distinct values, it would be necessary to backtrack to a(8) = 2 and try a different candidate.
		

Crossrefs

A382908 Lexicographically earliest sequence of positive integers such that the n-th pair of consecutive equal values are separated by a(n) distinct terms, with pairs numbered by their average index.

Original entry on oeis.org

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

Author

Neal Gersh Tolunsky, Apr 08 2025

Keywords

Comments

If two pairs have the same midpoint, the pair enclosing a shorter subsequence is considered first (in other words, the pair with the later first term and earlier second term).
Calculating terms may require backtracking, since pair numbers are not fixed until enough later terms either do or don't pair with earlier terms.

Examples

			The 1st pair (1,2,1) has average index 2 and encloses a(1) = 1 term.
The 2nd pair (2,1,3,2) has average index 3.5 and encloses a(2) = 2 distinct terms.
The 7th pair (4,1,3,2,5,2,4) has average index 10 and encloses a(7) = 4 distinct terms {1,2,3,5}.
The 8th pair (2,5,2) has average index 11 and encloses a(8) = 1 term.
Notice how the 2nd term of the 8th pair a(12) = 2 occurs earlier than the 2nd term of the 7th pair a(13) = 4. Because the average index (or center of the subsequence) is earlier in the case of the pair enclosing a(7) = 4 distinct terms, we consider it earlier than the pair enclosing a(8) = 1 term. If after setting a(12) = 2 enclosing a(8) = 1 term we had not been able to find a value to create a pair with an earlier average index to enclose a(7) = 4 distinct values, it would be necessary to backtrack to a(12) = 2 and try a different candidate.
		

Crossrefs

A382559 a(n) is the length of the longest subsequence at indices in arithmetic progression ending at a(n-1) whose terms form an arithmetic progression in some order; a(1)=1.

Original entry on oeis.org

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

Author

Neal Gersh Tolunsky, Apr 01 2025

Keywords

Comments

First differs from A362881 at a(15).
This is a variant of A362881 in which the terms of an arithmetic progression can occur in any order.

Examples

			a(21) = 4: The subsequence at indices i = 2,8,14,20 (common difference 6) is {1,3,2,4} which can be rearranged to form the arithmetic progression {1,2,3,4}. We find that the longest such subsequence ending at a(20) has length 4, so a(21) = 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

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

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

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

A381629 Lexicographically earliest sequence of positive integers such that no subsequence of terms at indices in arithmetic progression form an arithmetic progression in any order.

Original entry on oeis.org

1, 1, 2, 1, 1, 2, 2, 4, 4, 1, 1, 2, 1, 1, 2, 2, 4, 4, 2, 4, 4, 5, 5, 8, 5, 5, 9, 9, 4, 2, 5, 11, 2, 2, 4, 1, 1, 5, 1, 1, 10, 2, 2, 4, 1, 1, 4, 4, 10, 10, 4, 10, 10, 12, 2, 4, 1, 2, 5, 4, 5, 10, 4, 2, 8, 2, 10, 5, 5, 10, 5, 13, 12, 13, 2, 5, 10, 5, 10, 10, 13, 5
Offset: 1

Author

Neal Gersh Tolunsky, Mar 29 2025

Keywords

Comments

First differs from A361933 at a(52).
This is a variant of A361933 generalized to arithmetic progressions of any nontrivial length (3 or greater).

Examples

			a(52) cannot be values 1-7 without creating an arithmetic progression. a(52) cannot be 8 because the terms at i = 22,32,42,52 (common difference 10) would have the terms 5,11,2,8, which, rearranged, form the progression 2,5,8,11 (common difference 3). a(52) cannot be 9 because the terms at i = 38,45,52 (common difference 7) would have the terms 5,1,9, which in the order 1,5,9 form an arithmetic progression (common difference 4). So a(52) = 10.
		

Crossrefs

Cf. A361933.