%I #13 Mar 16 2021 08:39:54
%S 1,1,1,2,2,2,2,3,4,4,4,4,4,5,6,6,7,8,8,8,8,8,8,9,10,10,11,12,12,12,13,
%T 14,14,15,16,16,16,16,16,16,16,17,18,18,19,20,20,20,21,22,22,23,24,24,
%U 24,24,25,26,26,27
%N Meta-Fibonacci sequence a(n) with parameters s=2.
%H C. Deugau and F. Ruskey, <a href="http://www.cs.uwaterloo.ca/journals/JIS/VOL12/Ruskey/ruskey6.pdf">Complete k-ary Trees and Generalized Meta-Fibonacci Sequences</a>, J. Integer Seq., Vol. 12. [This is a later version than that in the GenMetaFib.html link]
%H C. Deugau and F. Ruskey, <a href="http://www.cs.uvic.ca/~ruskey/Publications/MetaFib/GenMetaFib.html">Complete k-ary Trees and Generalized Meta-Fibonacci Sequences</a>
%H B. Jackson and F. Ruskey, <a href="https://doi.org/10.37236/1052">Meta-Fibonacci Sequences, Binary Trees and Extremal Compact Codes</a>, Electronic Journal of Combinatorics, 13 (2006), #R26, 13 pages.
%F If 1 <= n <= 3, a(n)=1. If n = 4, then a(n)=2. If n>4 then a(n)=a(n-2-a(n-1)) + a(n-3-a(n-2)).
%F G.f.: A(z) = z * (1 - z^2) / (1 - z) * sum(prod(z^2 * (1 - z^(2 * [i])) / (1 - z^[i]), i=1..n), n=0..infinity), where [i] = (2^i - 1).
%p a := proc(n)
%p option remember;
%p if n <= 3 then return 1 end if;
%p if n <= 4 then return n-2 end if;
%p return add(a(n - i - 1 - a(n - i)), i = 1 .. 2)
%p end proc
%Y Cf. A120512, A120523.
%K nonn
%O 1,4
%A _Frank Ruskey_ and Chris Deugau (deugaucj(AT)uvic.ca), Jun 20 2006
|