A350768 a(1)=1. Thereafter, if a(n) is a term that has appeared exactly k times prior to and including itself then a(n+1) is the number of terms prior to and including a(n) which have appeared exactly k times.
1, 1, 2, 1, 3, 2, 2, 6, 2, 4, 3, 2, 5, 3, 6, 2, 6, 9, 3, 4, 2, 7, 3, 5, 4, 9, 4, 4, 10, 2, 8, 3, 6, 4, 12, 4, 7, 6, 5, 6, 12, 6, 14, 3, 21, 4, 16, 5, 4, 9, 6, 16, 6, 18, 5, 5, 6, 10, 8, 10, 9, 4, 20, 4, 11, 5, 14, 10, 8, 6, 22, 5, 16, 9, 5, 9, 6, 12, 12, 8, 12
Offset: 1
Keywords
Examples
a(1)=1 is a first occurrence, so a(2) is the number of first occurrences prior to and including a(1), thus a(2)=1. a(2) is a term seen twice and no other term has been seen twice, so a(3)=2. Since a(3)=2 is a novel term, a(4)=1, the number of terms seen exactly once so far.
Links
- Neal Gersh Tolunsky, Table of n, a(n) for n = 1..10000
- Michael De Vlieger, Scatterplot of a(n), n = 1..2^20.
- Michael De Vlieger, Log-log scatterplot of a(n), n = 1..2^12. Records are annotated in red, last occurrence of m appears in blue, and we highlight the first appearance of m in gold, second in green, and third in cyan. This is an attempt to explain striations in large-scale scatterplots.
- Michael De Vlieger, Log-log scatterplot of a(n), n = 1..2^12, using a spectral color function where red corresponds to the lowest values of c(m), and blue-magenta the highest values of c(m). As expected, as n increases, m appears increasingly often, however, some m appear more often than others.
- Michael De Vlieger, Log-log scatterplot of a(n), n = 1..2^12, using a spectral color function where red corresponds to the lowest values of q(m), and blue-magenta the highest values of q(m). Generally, small m have a lower frequency q(m) than do higher m, but the gradient is impure.
- Kevin Ryde, PARI/GP Code
Crossrefs
Cf. A000027.
Programs
-
Mathematica
Block[{c, j, k, q, u, nn}, c[] = q[] = 0; j = c[j] = 1; {j}~Join~Reap[Do[Set[k, c[j]]; q[k]++; q[k - 1]--; k = k*q[k]; Sow[k]; c[k]++; j = k, {i, 2, 120}] ][[-1, -1]] ] (* Michael De Vlieger, Jan 14 2022 *)
-
PARI
lista(nn) = {my(list=List(1), k, kk); for (n=2, nn, k = #select(x->(x==list[n-1]), list); kk = sum(i=1, #list, #select(x->(x==list[i]), list) == k); listput(list, kk); ); Vec(list);} \\ Michel Marcus, Jan 15 2022
Extensions
More terms from Michael De Vlieger, Jan 14 2022
Comments