Without using recursion and cycles, find the sum of the numbers of the Fibonacci series from 1 to n.

  • What is the source of the problem? - morin
  • Are you sure this is possible? This is not some kind of arithmetic progression to count with one blow .. try to ask in math. - cy6erGn0m

3 answers 3

The sum of elements up to n is just F (n + 2) - 1 . That is, you need to find the Fibonacci number one by one from the n- th and subtract one.

How to find the necessary Fibonacci number You have already written Stanislav.

    This is done very simply using the Binet formula , which explicitly expresses the value of a number depending on its ordinal number in the Fibonacci series.

      Fibonacci numbers

      The very first identity is just what you need. The formula for the n-th member is written higher.

      • So what's the point of the nth element? Need amount. - cy6erGn0m