login
A049929
a(n) = a(1) + a(2) + ... + a(n-1) - a(m) for n >= 4, 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, a(2) = 3, and a(3) = 4.
1
1, 3, 4, 5, 12, 20, 41, 83, 168, 254, 550, 1121, 2250, 4507, 9015, 18031, 36064, 54098, 117212, 238932, 480121, 961371, 1923313, 3846922, 7693930, 15387945, 30775932, 61551885, 123103778, 246207563, 492415127, 984830255, 1969660512
OFFSET
1,2
COMMENTS
Empirical: Lim_{n->infinity} a(n+1)/a(n) = 2. - Iain Fox, Dec 05 2017
FORMULA
a(n) = (Sum_{i=1..n-1} a(i)) - a(2^ceiling(log_2(n-1)) + 2 - n) for n > 3. - Iain Fox, Dec 06 2017
For n > 3, a(n) is the sum of all previous terms except a(A080079(n-2)). - Iain Fox, Dec 13 2017
EXAMPLE
For n = 4, 2^p < 3 <= 2^(p+1), so p = 1, m = 2^2 + 2 - 4 = 2, and a(n) = a(1) + a(2) + a(3) - a(2) = 1 + 3 + 4 - 3 = 5.
For n = 6, 2^p < 5 <= 2^(p+1), so p = 2, m = 2^3 + 2 - 6 = 4, and a(n) = a(1) + a(2) + a(3) + a(4) + a(5) - a(4) = 1 + 3 + 4 + 5 + 12 - 5 = 20.
MATHEMATICA
Fold[Append[#1, Total@ #1 - #1[[2^Ceiling@ Log2@ #2 + 1 - #2]] ] &, {1, 3, 4}, Range[3, 32]] (* Michael De Vlieger, Dec 06 2017 *)
PROG
(PARI) first(n)= my(res = vector(n), s = 8); res[1]=1; res[2]=3; res[3]=4; for(x=4, n, res[x] = s - res[2*2^logint(x-2, 2)+2-x]; s += res[x]); res; \\ Iain Fox, Dec 05 2017
CROSSREFS
KEYWORD
nonn
EXTENSIONS
Name edited by Petros Hadjicostas, Nov 06 2019
STATUS
approved