Skip to content

Fib1000 #64

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 7 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
18 changes: 18 additions & 0 deletions Python/25. 1000-digit Fibonacci number/1000_Fibonacci_number.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
'''
1000-digit Fibonacci number
Problem 25

'''

i = 0
first_number = 0
second_number = 1

while True:
if i % 2 == 0:
first_number += second_number
elif i % 2 == 1:
second_number += first_number
i += 1
if len(str(first_number)) == 1000 or len(str(second_number)) == 1000: break
print(i)
26 changes: 26 additions & 0 deletions Python/30. Digit fifth powers/30.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
d1 = 0
d2 = 0
d3 = 0
d4 = 0
d5 = 0
numbers = []

while True:
num = (d1**5) + (d2**5) + (d3**5) + (d4**5) + (d5**5)
if str(num) == str(d1) + str(d2) + str(d3) + str(d4) + str(d5):
number.append(num)
d5 += 1
if d5 >= 9:
d5 = 0
d4 += 1
if d4 >= 9:
d4 = 0
d3 += 1
if d3 >= 9:
d3 = 0
d2 += 1
if d2 >= 9:
d2 = 0
d1 += 1
if d1 >= 9: break

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ Project Euler is a series of challenging problems that require mathematical and
|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)| | | | | | |
|29 |[Distinct powers](https://projecteuler.net/problem=29)| | | | | | |
|30| [Digit fifth powers](https://projecteuler.net/problem=30)| | | | | | |
|30| [Digit fifth powers](https://projecteuler.net/problem=30)| | | | :white_check_mark: | | |
|31| [Coin sums ](https://projecteuler.net/problem=31)| | | | | | |
|32| [Pandigital products](https://projecteuler.net/problem=32)| | | | | | |
|33 |[Digit cancelling fractions](https://projecteuler.net/problem=33)| | | | | | |
Expand Down