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.

A363301 a(1)=1, and thereafter, a(n) is the number of terms in the sequence thus far that appear with a frequency equal to or less than that of a(n-1).

Original entry on oeis.org

1, 1, 2, 1, 4, 2, 3, 2, 8, 3, 4, 5, 2, 13, 3, 11, 4, 13, 5, 6, 3, 21, 4, 23, 5, 13, 14, 6, 7, 6, 18, 7, 8, 9, 6, 35, 7, 21, 10, 7, 40, 8, 22, 9, 12, 9, 26, 10, 13, 49, 10, 27, 11, 14, 15, 10, 56, 11, 30, 12, 17, 12, 34, 13, 64, 14, 37, 15, 18, 19, 14, 66, 15, 40, 20, 15, 71, 16, 17, 24, 17, 44, 18, 46, 19, 24
Offset: 1

Views

Author

Neal Gersh Tolunsky, May 26 2023

Keywords

Examples

			a(3)=2 because a(2)=1 occurs with a frequency of 2 and there are two terms in the sequence thus far that appear with a frequency of 2 or less (1, 1).
a(6)=3 because a(5)=2 occurs with a frequency of 2 and there are three terms that appear with a frequency of 2 or less (2, 2, and 4).
		

Crossrefs

Cf. A350768.

Programs

  • Python
    from itertools import islice
    from collections import Counter
    def agen(): # generator of terms
        an, c, freqs = 1, Counter(), Counter()
        while True:
            if an in c:
                freqs[c[an]] -= 1
            c[an] += 1
            freqs[c[an]] += 1
            yield an
            an = sum(v*freqs[v] for v in range(1, c[an]+1))
    print(list(islice(agen(), 86))) # Michael S. Branicky, May 26 2023