We want to write two peograms:

I: write a program from the investor takes the values of r, n (where r, n positive values greater than the correct one)

And calculates the total shown in relation (1) and shows the value

And then calculates the total of the relationship (2) and shows the value

Note: This program prevents the use of instruction for and can be usedas power continued ()Math.pow

Where 1 is the sequential mathematical and 2 is the relationship between total sequential

II:We want to write a program the same functionality but does not take the values of n, r from the user, but is calculated directly from the totals for n takes the values 8, 9, 10 and for r takes the values 2.3, 4.

In other words, the result will be calculated for each binary n, r by the previous section.

Instruction for use in this program

the relationships are:

P(r,n)= sum r pow i ....(1)

P(r,n)= sum r pow i = r pow n+1 _1 / r-1 ...(2)