I have an algorithm, and I need to calculate its complexity. I’m close to the answer but I have a little math problem: what is the summation formula of the series
½(n4+n3) where the pattern of n is 1, 2, 4, 8, … so the series becomes:
½(14+13) + ½(24+23) + ½(44+43) + ½(84+83) + …
It might help to express n as 2^k for k=0,1,2…
Substitute that into your original formula to get terms of the form (16^k + 8^k)/2.
You can break this up into two separate sums (one with base 16 and one with base 8),
each of which is a geometric series.
S1 = 1/2(16^0 + 16^1 + 16^2 + …)
S2 = 1/2(8^0 + 8^1 + 8^2 + …)
The J-th partial sum of a geometric series is a(1-r^J)/(1-r) where a is the initial
value and r the ratio between successive terms. For S1, a=1/2, r=16. For S2, a=1/2,
r=8.
Multiply it out and I believe you will find that the sum of the first J terms is O(16^J).