It is required to solve two problems:
Given the number n (the number of elements) and an arbitrary real a . It is necessary to find the sum of the first n elements of the first members of the series:
1 / a 2 + 3! / a 4 + 5! / a 6 + 7! / a 8 + ...
It is necessary to solve with the obligatory use of the formula of recurrent relations.
I got this formula, but it turns out some kind of game when executing the program:
f(i) = 1 / ((2 * i - 2) * (2 * i - 3) * a * a);Given a real number x . Without using any other operations, except multiplication, addition and subtraction, calculate the values of the expressions:
1 - 2x + 3x 2 - 4x 3
and
1 + 2x + 3x 2 + 4x 3
It is allowed to use no more than eight operations (this is in sum for both expressions). Only three additional variables are allowed ( x is not considered).
I sat over the task, but I always have one character difference when I make a common factor.
My sketch, non-working:
float x, rez_one, rez_two, buf; pt >> x; buf = x * ((-x) * (4 * x - 3) - 2); rez_one = 1 + buf; rez_two = 1 - buf; pt << rez_one; pt << rez_two;


