mirror of
https://github.com/jlengrand/project_euler.git
synced 2026-03-10 08:41:20 +00:00
Solves 4 problems.
Eclipse integration for simpler use with Windows. Still have to perform some good work on prime numbers! Signed-off-by: Julien Lengrand-Lambert <julien@lengrand.fr>
This commit is contained in:
30
e_28.py
Normal file
30
e_28.py
Normal file
@@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env python
|
||||
'''
|
||||
Created on 8 feb. 2012
|
||||
|
||||
@author: Julien Lengrand-Lambert
|
||||
|
||||
DESCRIPTION: Solves problem 28 of Project Euler
|
||||
Starting with the number 1 and moving to the right in a clockwise direction a 5 by 5 spiral is formed as follows:
|
||||
|
||||
21 22 23 24 25
|
||||
20 7 8 9 10
|
||||
19 6 1 2 11
|
||||
18 5 4 3 12
|
||||
17 16 15 14 13
|
||||
|
||||
It can be verified that the sum of the numbers on the diagonals is 101.
|
||||
|
||||
What is the sum of the numbers on the diagonals in a 1001 by 1001 spiral formed in the same way?
|
||||
'''
|
||||
def sum_power():
|
||||
"""
|
||||
Finds
|
||||
"""
|
||||
|
||||
|
||||
return 1
|
||||
|
||||
if __name__ == '__main__':
|
||||
# The major problem in there is to find the upper limit.
|
||||
print "Answer : %d " % (sum_power())
|
||||
Reference in New Issue
Block a user