Fibonacci matrix-exponentiation: Difference between revisions

m
added whitespace and highlighting, made an aligned (indented) table (instead of a list), inserted commas, added a missing article ("the"), changed sentence structure.
(Added Wren)
m (added whitespace and highlighting, made an aligned (indented) table (instead of a list), inserted commas, added a missing article ("the"), changed sentence structure.)
Line 1:
{{draft task|Matrices}}[[Category:Mathematics]]
[[Category:Mathematics]]
 
The '''Fibonacci sequence''' defined with [[wp:Fibonacci_number#Matrix_form|matrix-exponentiation]]:
::::: <math>\begin{pmatrix} 1 & 1 \\ 1 & 0 \end{pmatrix}^n = \begin{pmatrix} F_{n+1} & F_n \\ F_n & F_{n-1} \end{pmatrix}.</math>
 
 
;Task:
Write a program using matrix exponentiation to generate Fibonacci(n) for &nbsp; '''n''' &nbsp; equal to: 10, 100, 1_000, 10_000, 100_000, 1_000_000 and 10_000_000.
:::* &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 10
:::* &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 100
:::* &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1,000
:::* &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 10,000
:::* &nbsp; &nbsp; &nbsp; &nbsp; 100,000
:::* &nbsp;&nbsp; &nbsp; 1,000,000
:::* &nbsp;&nbsp; 10,000,000
 
 
DisplayOnly onlydisplay the first '''20''' firstdecimal digits &nbsp; and 20&nbsp; the last '''20''' decimal digits of each Fibonacci number.
 
;Extra:
Generate Fibonacci(2<sup>16 </sup>), Fibonacci(2<sup>32</sup>) and Fibonacci(2<sup>64</sup>) using the same method or another one.
 
 
;Related tasks:
* &nbsp; [[Fibonacci sequence]]
* &nbsp; [[Matrix-exponentiation operator]]
<br/><br>
 
=={{header|C sharp|C#}}==