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).
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
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).
Links
- Neal Gersh Tolunsky, Table of n, a(n) for n = 1..10000
- Neal Gersh Tolunsky, Graph of the first 100000 terms
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