Back to Cosmos

Project Euler Problem #025: 1000-digit Fibonacci number

code/online_challenges/src/project_euler/problem_025/README.md

latest931 B
Original Source

Project Euler Problem #025: 1000-digit Fibonacci number

(Problem Link)

The Fibonacci sequence is defined by the recurrence relation:

<p align="center"> F<sub>n</sub> = F<sub>n−1</sub> + F<sub>n−2</sub>, where F<sub>1</sub> = 1 and F<sub>2</sub> = 1. </p>

Hence the first 12 terms will be:

<p align="center"> F<sub>1</sub> = 1 F<sub>2</sub> = 1 F<sub>3</sub> = 2 F<sub>4</sub> = 3 F<sub>5</sub> = 5 F<sub>6</sub> = 8 F<sub>7</sub> = 13 F<sub>8</sub> = 21 F<sub>9</sub> = 34 F<sub>10</sub> = 55 F<sub>11</sub> = 89 F<sub>12</sub> = 144 </p>

The 12th term, F<sub>12</sub>, is the first term to contain three digits.

What is the index of the first term in the Fibonacci sequence to contain 1000 digits?


<p align="center"> A massive collaborative effort by <a href="https://github.com/OpenGenus/cosmos">OpenGenus Foundation</a> </p>