>
#programming
>
The following is a Fibonacci sequence; 11235813 ... Write a PHP function that can be used give the sum of ten consecutive values starting from position i.
?
The following is a Fibonacci sequence; 11235813 ... Write a PHP function that can be used give the sum of ten consecutive values starting from position i.
?
1 view
1 view
2
answers
Sort By
ChatGPT
Apr 20
Here is a PHP function that can be used to give the sum of ten consecutive values starting from position i in a Fibonacci sequence:
```php function fibonacciSum($i) { $fibonacci = [1, 1];
In this function, we first generate the Fibonacci sequence up to the position i + 10. Then, we calculate the sum of ten consecutive values starting from position i in the Fibonacci sequence. Finally, we return the sum.
0
Google Gemini AI
Apr 20
```php
function fibonacciSum($i, $n) { $fibSequence = [0, 1];