%I #25 May 06 2022 13:12:16
%S 1,3,2,3,6,12,24,39,51,138,276,543,1059,2019,3633,5790,7809,21405,
%T 42810,85611,171195,342291,684177,1366878,2729985,5444355,10824504,
%U 21392328,41760069,79442661,142937349,227824365,307267026,842358414
%N a(n) = a(1) + a(2) + ... + a(n-1) - a(m) for n >= 4, where m = 2*n - 2 - 2^(p+1) and p is the unique integer such that 2^p < n - 1 <= 2^(p+1), starting with a(1) = 1, a(2) = 3, and a(3) = 2.
%o (PARI) lista(nn) = { my(va = vector(nn)); va[1] = 1; va[2] = 3; va[3] = 2; my(sa = vecsum(va)); for (n=4, nn, va[n] = sa - va[2*n - 2 - 2^ceil(log(n-1)/log(2))]; sa += va[n]; ); va; } \\ _Petros Hadjicostas_, Apr 26 2020 (with nn > 2)
%Y Cf. A049922 (similar, but with minus a(m/2)), A049970 (similar, but with plus a(m/2)), A049971 (similar, but with plus a(m)).
%K nonn
%O 1,2
%A _Clark Kimberling_
%E Name edited by _Petros Hadjicostas_, Apr 26 2020