156
Proofs, Induction, and Number Theory
For Exercises 1–5, write a computer program that produces the desired output from the given input.
1. Input: Number n of terms in a geometric progression (see Exercise 27, Section 2.2), the initial term
a, and the common ratio r
Output: Sum of the first n terms using
a. iteration
b. formula of Exercise 27, Section 2.2
2. Input: Number n of terms in an arithmetic progression (see Exercise 28, Section 2.2), the initial term
a, and the common difference d
Output: Sum of the first n terms using
a. iteration
b. formula of Exercise 28, Section 2.2
3. Input: Number n
Output: Sum of the first n cubes using
a. iteration, using only multiplication and addition; output the number of multiplications and
additions used
b. formula of Exercise 8, Section 2.2, using only
multiplication, addition, and division; output
the number of multiplications, additions, and
divisions used
4. Input: None
Output: Table showing every integer n, 8 ≤ n ≤ 100,
as the sum of 3s and 5s (see Example 24)
5. Input: Value for n
Output: Value for φ(n)
6. The formula 4
n
< n! is true for all n ≥ N. Write a
program to determine N and then prove the result
by induction.
7. The formula 2
n
> n
3
is true for all n ≥ N. Write a
program to determine N and then prove the result
by induction.
o n t H e c o M P u t e R
Précédent

- 173/986

Suivant