You are on page 1of 11

Sample Algorithms

Common Summations
n
n( n  1)
• Arithmetic series:  k  1  2  ...  n 
k 1 2
n
x n 1  1
• Geometric series: 
k 0
x  1  x  x  ...  x 
k 2 n

x 1
x  1

1
– Special case: |x| < 1: x
k 0
k

1 x
n
1 1 1
• Harmonic series: 
k 1 k
 1 
2
 ... 
n
 ln n

• Other important formulas:  lg k  n lg n


k 1

n
1
 k p  1p  2 p  ...  n p 
k 1 p 1
n p 1

You might also like