A330332 a(n) = (number of times a(n-1) has already appeared) + (number of times a(n-2) has already appeared) + (number of times a(n-3) has already appeared), starting with a(n) = n for n<3.
0, 1, 2, 3, 3, 5, 5, 6, 5, 7, 5, 9, 6, 7, 5, 9, 9, 11, 7, 7, 9, 12, 9, 11, 8, 8, 6, 7, 10, 9, 12, 9, 16, 10, 10, 7, 12, 12, 14, 9, 13, 10, 13, 8, 9, 14, 14, 15, 7, 11, 11, 15, 10, 11, 12, 15, 13, 11, 12, 15, 16, 12, 13, 13, 17, 11, 13, 14, 17, 12, 14, 15, 18, 11, 14, 15, 20, 13, 14, 15, 21, 15
Offset: 0
Links
- N. J. A. Sloane, Table of n, a(n) for n = 0..10000
- Rémy Sigrist, Density plot of the first 2^22 terms
Programs
-
Maple
b:= proc() 0 end: a:= proc(n) option remember; local t; t:= `if`(n<3, n, b(a(n-1))+b(a(n-2))+b(a(n-3))); b(t):= b(t)+1; t end: [seq(a(n), n=0..200)]; # Following Alois P. Heinz's program for A316774
-
Mathematica
b[_] = 0; a[n_] := a[n] = Module[{t}, t = If[n<3, n, b[a[n-1]] + b[a[n-2]] + b[a[n-3]]]; b[t]++; t]; a /@ Range[0, 200] (* Jean-François Alcover, Nov 09 2020, after Maple *)
Comments