login
a(n) = a(1) + a(2) + ... + a(n-1) + a(m) for n >= 4, where m = 2*n - 3 - 2^(p+1) and p is the unique integer such that 2^p < n-1 <= 2^(p+1), with a(1) = 1, a(2) = 3, and a(3) = 1.
9

%I #40 Jul 20 2020 02:01:29

%S 1,3,1,6,12,24,48,107,250,453,906,1823,3682,7566,15788,34352,80810,

%T 145833,291666,583343,1166722,2333646,4667948,9338672,18689450,

%U 37443922,75098700,151072456,305646138,625313778,1307036806,2844621050,6690632768,12074228731,24148457462,48296914935,96593829906

%N a(n) = a(1) + a(2) + ... + a(n-1) + a(m) for n >= 4, where m = 2*n - 3 - 2^(p+1) and p is the unique integer such that 2^p < n-1 <= 2^(p+1), with a(1) = 1, a(2) = 3, and a(3) = 1.

%F a(n) = a(2*n - 3 - 2^ceiling(log_2(n-1))) + Sum_{i = 1..n-1} a(i) = a(A006257(n-2)) + Sum_{i = 1..n-1} a(i) for n >= 4 with a(1) = 1, a(2) = 3, and a(3) = 1. - _Petros Hadjicostas_, Sep 24 2019

%e From _Petros Hadjicostas_, Sep 24 2019: (Start)

%e a(4) = a(1) + a(2) + a(3) + a(m=1) = 1 + 3 + 1 + 1 = 6 because m = A006257(4-2) = 2*4 - 3 - 2^ceiling(log_2(4-1)) = 1.

%e a(5) = a(1) + a(2) + a(3) + a(4) + a(m=3) = 1 + 3 + 1 + 6 + 1 = 12 because m = A006257(5-2) = 2*5 - 3 - 2^ceiling(log_2(5-1)) = 3.

%e a(6) = a(1) + a(2) + a(3) + a(4) + a(5) + a(m=1) = 1 + 3 + 1 + 6 + 12 + 1 = 24 because m = A006257(6-2) = 2*6 - 3 - 2^ceiling(log_2(6-1)) = 1.

%e (End)

%p a := proc(n) option remember; if n<4 then return [1,3,1][n] fi; add(a(i), i=1..n-1) + a(2*(n-2) - Bits:-Iff(n-2, n-2)) end: seq(a(n), n=1..37); # _Petros Hadjicostas_, Sep 24 2019, courtesy of _Peter Luschny_

%Y Cf. A006257, A049939, A049940, A049960.

%K nonn

%O 1,2

%A _Clark Kimberling_

%E Name edited by and more terms from _Petros Hadjicostas_, Sep 23 2019