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.

A363193 a(1)=1, and thereafter a(n) = number of occurrences of a(k) among terms a(1..k), where k = n-a(n-1).

Original entry on oeis.org

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

Views

Author

Neal Gersh Tolunsky, May 20 2023

Keywords

Examples

			For n=5, a(5) is the number of times a(5 - a(5-1)) = a(5 - a(4)) = a(3) = 2 has occurred in the sequence among a(1..3). It has occurred 1 time up to that point, so a(5)=1.
		

Crossrefs

Cf. A354971.

Programs

  • Python
    from bisect import bisect
    from itertools import count, islice
    def agen(): # generator of terms
        an, a, locs = 1, [None, 1], {1: [1]}
        yield 1
        for n in count(2):
            k = n-an
            an = bisect(locs[a[k]], k) # sum(1 for i in locs[a[k]] if i <= k)
            a.append(an)
            if an not in locs: locs[an] = []
            locs[an].append(n)
            yield an
    print(list(islice(agen(), 86))) # Michael S. Branicky, May 23 2023

A366548 a(0) = 0; for n > 0, a(n) is the number of terms prior to the term a(n-1-a(n-1)) that equal a(n-1-a(n-1)).

Original entry on oeis.org

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

Views

Author

Scott R. Shannon, Oct 13 2023

Keywords

Comments

In the first 10 million terms the value 4 appears the most often, 11838 times, although the count of neighboring values is less than 2% different. It is unknown if this stays the most common term as n increases. In the same range on thirty-eight occasions there are three consecutive equal terms, the first time being a(105) = a(106) = a(107) = 8. It is unknown if four or more consecutive terms eventually appear.

Examples

			a(2) = 1 as a(2-1-a(2-1)) = a(1-0) = a(1) = 0, and there is one term prior to a(1) that equals 0, namely a(0).
a(6) = 1 as a(6-1-a(6-1)) = a(5-2) = a(3) = 1, and there is one term prior to a(3) that equals 1, namely a(2).
		

Crossrefs

A366549 a(0) = 0; for n > 0, a(n) is the number of terms prior to and including the term a(n-1-a(n-1)) that equal a(n-1-a(n-1)).

Original entry on oeis.org

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

Views

Author

Scott R. Shannon, Oct 13 2023

Keywords

Comments

In the first 10 million terms the value 1 appears the most often, 13584 times, although the count of neighboring values is less than 2% different. It is unknown if this stays the most common term as n increases. In the same range on fifty occasions there are three consecutive equal terms, the second time, after the three 1's at the start of the sequence, being a(406) = a(407) = a(408) = 11. It is unknown if four or more consecutive terms eventually appear.

Examples

			a(2) = 1 as a(2-1-a(2-1)) = a(1-1) = a(0) = 0, and there is one term prior to or equal to a(0) that equals 0, namely a(0).
a(6) = 3 as a(6-1-a(6-1)) = a(5-2) = a(3) = 1, and there are three terms prior to or equal to a(3) that equal 1, namely a(1), a(2) and a(3).
		

Crossrefs

Showing 1-3 of 3 results.