OFFSET
1,3
LINKS
Neal Gersh Tolunsky, Table of n, a(n) for n = 1..10000
Neal Gersh Tolunsky, Graph of the first 100000 terms
EXAMPLE
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).
PROG
(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
CROSSREFS
KEYWORD
nonn
AUTHOR
Neal Gersh Tolunsky, May 26 2023
STATUS
approved