There is such a task: For the sequence A1 = 1, An + 1 = An + 1 / (1 + An), make up the program for printing the k-th member as an ordinary irreducible fraction. For example, A2 = 3/2, A3 = 19/10.

I can write the program myself, I can not figure out where the numbers come from A2 = 3/2, A3 = 19/10. If we assume that the formula: A2 = 1 + 1 / (1 + 1) = 3/3, A3 = 2 + 1 / (1 + 2) = 3/3. Where are the numbers 3/2, 19/10? How to get them?

Closed due to the fact that it is off topic by Nicolas Chabanovsky 21 Sep '16 at 7:12 .

  • Most likely, this question does not correspond to the subject of Stack Overflow in Russian, according to the rules described in the certificate .
If the question can be reformulated according to the rules set out in the certificate , edit it .

  • I vote for the closure of this issue as not relevant to the topic, because it does not apply to programming. - Nicolas Chabanovsky

1 answer 1

A2 = 1 + 1/(1 + 1) = 1 + 1/2 = 2/2 + 1/2 = (2+1)/2 = 3/2 A3 = A2 + 1/(1 + A2) = 3/2 + 1/(1 + 3/2) = 3/2 + 1 / (2/2 + 3/2) = 3/2 + 1 /(5/2) = 3/2 + 2/5 = 15/10 + 4/10 = (15+4)/10 = 19/10 
  • one
    Come, add a semicolon, that used in the pros gathered. - nick_n_a
  • 2
    Well, then you need to type A2 and A3: D - Andrew Bystrov