It is required to solve two problems:

  1. 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); 
  2. 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; 
  • If you are given an exhaustive answer, mark it as correct (a daw opposite the selected answer). - Nicolas Chabanovsky

1 answer 1

The second is easier than steamed turnip:

 y = x*x; // 1 z = 3*y+1; // 2,3 t = (4*y+2)*x; // 4,5,6 y = z - t; // 7 z = z + t; //8 

Values ​​are in y and z .

First, I would proceed from the general formula.

enter image description here

then

enter image description here

so or

enter image description here