login
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), with a(1) = a(2) = 1 and a(3) = 2.
10

%I #30 May 06 2022 13:12:16

%S 1,1,2,5,14,24,52,123,345,568,1140,2299,4697,9839,21409,50358,141235,

%T 232113,464230,928479,1857057,3714559,7430849,14869238,29778995,

%U 59739745,120175856,243137792,497430263,1039731033,2262860113

%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), with a(1) = a(2) = 1 and a(3) = 2.

%F a(n) = a(1 + A006257(n-2)) + Sum_{i = 1..n-1} a(i) for n >= 4 with a(1) = a(2) = 1 and a(3) = 2.

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

%e a(4) = a(1 + A006257(4-2)) + a(1) + a(2) + a(3) = a(2) + a(1) + a(2) + a(3) = 1 + 1 + 1 + 2 = 5.

%e a(5) = a(1 + A006257(5-2)) + a(1) + a(2) + a(3) + a(4) = a(4) + a(1) + a(2) + a(3) + a(4) = 5 + 1 + 1 + 2 + 5 = 14.

%e a(6) = a(1 + A006257(6-2)) + a(1) + a(2) + a(3) + a(4) + a(5) = a(2) + a(1) + a(2) + a(3) + a(4) + a(5) = 1 + 1 + 1 + 2 + 5 + 14 = 24.

%e (End)

%p a := proc(n) local i; option remember; if n < 4 then return [1, 1, 2][n]; end if; add(a(i), i = 1 .. n - 1) + a(2*n - 3 - Bits:-Iff(n - 2, n - 2)); end proc;

%p seq(a(n), n = 1 .. 37); # _Petros Hadjicostas_, Sep 24 2019, courtesy of _Peter Luschny_

%Y Cf. A006257, A049890 (similar, but with minus a(m/2)), A049891 (similar, but with minus a(m)), A049938 (similar, but with plus a(m/2)), A049940, A049960, A049964.

%K nonn

%O 1,3

%A _Clark Kimberling_

%E Name edited by _Petros Hadjicostas_, Sep 24 2019