Learn how to use loops.
Also note that
1 + 1/2 + 1/3 + 1/4 + .... = 1/1 + 1/2 + 1/3 + ... = sum(1/i, for i = 1 to n)
Your mission is to write the last expression in for loops which should be...