

A049978


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


1



1, 3, 4, 9, 20, 38, 78, 157, 319, 630, 1262, 2525, 5055, 10121, 20260, 40560, 81199, 162242, 324486, 648973, 1297951, 2595913, 5191844, 10383728, 20767535, 41535232, 83070775, 166142182, 332285627, 664573784, 1329152634, 2658315407, 5316651114, 10633261669, 21266523340, 42533046681, 85066093367, 170132186745
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,2


LINKS

Table of n, a(n) for n=1..38.


FORMULA

a(n) = a(n  1  2^ceiling(1 + log_2(n1))) + Sum_{i = 1..n1} a(i) = a((1 + A006257(n2))/2) + Sum_{i = 1..n1} a(i) for n >= 4 with a(1) = 1, a(2) = 3, and a(3) = 4.  Petros Hadjicostas, Sep 27 2019


EXAMPLE

From Petros Hadjicostas, Sep 27 2019: (Start)
a(4) = a(412^ceiling(1 + log_2(41))) + a(1) + a(2) + a(3) = a(1) + a(1) + a(2) + a(3) = 9.
a(5) = a(512^ceiling(1 + log_2(51))) + a(1) + a(2) + a(3) + a(4) = a(2) + a(1) + a(2) + a(3) + a(4) = 20.
a(6) = a(612^ceiling(1 + log_2(61))) + a(1) + a(2) + a(3) + a(4) + a(5) = a(1) + a(1) + a(2) + a(3) + a(4) + a(5) = 38.
(End)


MAPLE

a := proc(n) local i; option remember; if n < 4 then return [1, 3, 4][n]; end if; add(a(i), i = 1 .. n  1) + a(n  3/2  1/2*Bits:Iff(n  2, n  2)); end proc;
seq(a(n), n = 1 .. 37); # Petros Hadjicostas, Sep 27 2019 using a modification of a program by Peter Luschny


CROSSREFS

Cf. A006257, A049939, A049940, A049960, A049964.
Sequence in context: A110810 A247579 A282615 * A324764 A092763 A232955
Adjacent sequences: A049975 A049976 A049977 * A049979 A049980 A049981


KEYWORD

nonn


AUTHOR

Clark Kimberling


EXTENSIONS

Name edited by and more terms from Petros Hadjicostas, Sep 27 2019


STATUS

approved



