Skip to content

25 py3 #96

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions Python/25. 1000-digit Fibonacci number/25_fib.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
fib = [1,1]
flag = True
i = 0

while flag:

if len(str(fib[-1])) == 1000:
flag = False
fib.append(fib[i]+fib[i+1])

i += 1

print(len(fib))

"""
The index is 4783.
the first number with more than 1000 digits is
17314035892220029572944293465188957237095
06082039860786521776201969997425190002580
82050954692982026305845797555471858476789
76100325054968775073947440999809780969539
62557220579370143960032185044755214925165
47198513318616556256837295421226677516047
96909610833304073710409885044555868390939
10684051542272860673487922394300583546141
20107118152356776648269765199857613190738
34625845051829337701878934106028553629900
44627645611957937480375221691136281665191
10877048604620836598745715289789897815103
26245987819443785019532554078735089421913
56136619446735012761729556373994129675990
03658054156707915750021445184859010638027
69290047697352461449385286282853443883508
42365138183068393693524442382719001304601
98288002589837394201481410302209333257590
01477303514195940780923594525008254221732
32850278854098501036548721303293491571977
47164151383665878041365379866084191028403
20618292089896543323398436020869147026339
19395534251088908273898020000096184168171
55942940285800659653145999939415483224382
6895270097988797
"""
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Happy Contributing! 😃
| 22 | [Names scores](https://projecteuler.net/problem=22) | | | | | | | | | | | | |
| 23 | [Non-abundant sums](https://projecteuler.net/problem=23) | | | | | | | | | | | | |
| 24 | [Lexicographic permutations](https://projecteuler.net/problem=24) | | | | | | | | | | | | |
| 25 | [1000-digit Fibonacci number](https://projecteuler.net/problem=25) | | | | | | | | | | | | |
| 25 | [1000-digit Fibonacci number](https://projecteuler.net/problem=25) | | | | :white_check_mark: | | | | | | | | |
| 26 | [Reciprocal cycles](https://projecteuler.net/problem=26) | | | | | | | | | | | | |
| 27 | [Quadratic primes](https://projecteuler.net/problem=27) | | | | | | | | | | | | |
| 28 | [Number spiral diagonals](https://projecteuler.net/problem=28) | :white_check_mark: | | | :white_check_mark: | | | :white_check_mark: | | | | | |
Expand Down