A357943 a(0) = 0; a(1) = 1, a(2) = 2; for n > 2, a(n) is the number of times the term a(n - 1 - a(n-1)) has appeared in the sequence.
0, 1, 2, 1, 1, 3, 1, 1, 5, 5, 5, 1, 3, 3, 3, 6, 3, 5, 5, 5, 5, 1, 7, 1, 1, 9, 5, 9, 8, 8, 9, 9, 1, 4, 2, 10, 4, 10, 4, 2, 2, 3, 3, 4, 4, 4, 7, 4, 7, 7, 7, 7, 7, 7, 8, 8, 7, 9, 9, 9, 9, 9, 9, 9, 4, 11, 4, 11, 9, 12, 12, 12, 12, 12, 12, 12, 12, 9, 13, 2, 13, 2, 6, 8, 8, 8, 13, 8, 6, 3, 3, 8, 9, 9
Offset: 0
Examples
a(5) = 3 as the term at a(4 - a(4)) = a(4 - 1) = a(3) = 1, and 1 has appeared three times in the sequence.
Links
- Scott R. Shannon, Table of n, a(n) for n = 0..10000
- Scott R. Shannon, Image of the first 10000000 terms.
- Scott R. Shannon, Frequency distribution of the first 10000000 terms. The maximum x value is 4858, which is the number of times 20 has appeared.
Programs
-
Mathematica
nn = 83; c[] = 0; Array[Set[{a[#], c[#]}, {#, 1}] &, 3, 0]; Do[(a[n] = c[#]; c[c[#]]++) &[a[n - a[n - 1] - 1]], {n, 3, nn}]; Array[a, nn, 0] (* _Michael De Vlieger, Oct 23 2022 *)
Comments