%I #28 Nov 14 2019 10:44:04
%S 1,2,2,4,4,16,32,64,64,4096,131072,2097152,8388608,33554432,67108864,
%T 134217728,134217728,18014398509481984,1208925819614629174706176,
%U 40564819207303340847894502572032,340282366920938463463374607431768211456
%N a(1) = 1 and a(2) = 2. Subsequent terms are generated like this: if a(m) is the last term available -- say a(2) -- then a(m+1) = a(m) * a(m-1), a(m+2) = a(m) * a(m-1) * a(m-2), ..., a(2*m-1) = a(m) * a(m-1) * a(m-2) * ... * a(2) * a(1), a(2*m) = a(2*m-1) * a(2*m-2), and so on.
%C By choosing appropriate values for a(1) and a(2), many such sequences can be generated.
%F From _Petros Hadjicostas_, Nov 13 2019: (Start)
%F a(n) = a(n-1) * a(m) for n >= 3, where m = 2^(p+1) + 2 - n and p is the unique integer such that 2^p < n - 1 <= 2^(p+1), starting with a(1) = 1 and a(2) = 2.
%F a(A000051(n)) = a(2^n + 1) = a(2^n) for n >= 1.
%F a(A000051(n) + 1) = a(2^n + 2) = a(2^n + 1) * a(2^n) = a(2^n)^2 for n >= 1.
%F log[2](a(n)) = A329474(n) for n >= 1. (End)
%e a(3) = a(2)*a(1) = 2. [Now a(3) is the last term available.]
%e a(4) = a(3)*a(2) = 4.
%e a(5) = a(3)*a(2)*a(1) = 4. [Now a(5) is the last term available.]
%e a(6) = a(5)*a(4) = 16.
%e a(7) = a(5)*a(4)*a(3) = 32.
%e a(8) = a(5)*a(4)*a(3)*a(2) = 64.
%e a(9) = a(5)*a(4)*a(3)*a(2)*a(1) = 64. [Now a(9) is the last term available.]
%e a(10) = a(9)*a(8) = 4096.
%e a(11) = a(9)*a(8)*a(7) = 131072.
%e ...
%e a(17) = a(9)*a(8)*...*a(1) = 134217728. [Now a(17) is the last term available.]
%e a(18) = a(17)*a(16) = 18014398509481984.
%e [Example extended by _Petros Hadjicostas_, Nov 13 2019]
%p a := proc(n) option remember;
%p `if`(n < 3, [1, 2][n], a(n - 1) * a(2^ceil(log[2](n - 1)) + 2 - n));
%p end proc;
%p seq(a(n), n = 1..25); # _Petros Hadjicostas_, Nov 13 2019
%Y Cf. A000051 (index of "available" terms as described above), A050049 (an additive version of this sequence), A329474 (log[2] of this sequence).
%K easy,nonn
%O 1,2
%A _Amarnath Murthy_, Aug 01 2005
%E More terms from _Joshua Zucker_, May 10 2006