## M2160-1 First Homework Assignment.   Due Jan. 20, 2006.

1. Write a program to calculate partial sums for the infinite series

1/e + 2/e2 + 3/e3 + 4/e4 + 5/e5 +...

Here e=2.718281828... is the base for the natural logarithms and e2 means e squared. This series is convergent (by the integral test). Can you figure out what is the approximate value of its sum accurate up to six decimal places? How many terms in the sum are needed to get the desired accuracy?

2. Write a program to calculate partial sums for the infinite series

1/e - 2/e2 + 3/e3 - 4/e4 + 5/e5 -...

This series is convergent (by the Leibniz test). Can you figure out what is the approximate value of its sum accurate up to six decimal places? How many terms in the sum are needed to get the desired accuracy? How does this compare with the results of first problem? Which series converges faster?

3. Write a program to enter the variable k and investigate the limit of a sequence L = limn->∞ yn, where

yn = ( 1 + k/n)n.

Print a table with two columns, n and yn where n runs from 1 to 10, then to 100 in steps of 10, then to 1000 in steps of 100 and then to 10000 in steps of 1000. Finally, print the theoretical limiting value, L, of the sequence.