Skip to content

Commit 96a9321

Browse files
committed
Solve Number Spiral Diagonals in python
1 parent a915af9 commit 96a9321

File tree

4 files changed

+19
-0
lines changed

4 files changed

+19
-0
lines changed

solutions/project-euler/028/028.py

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
SIZE = 1001
2+
3+
n = 1
4+
count = 0
5+
total = n
6+
step = 2
7+
while True:
8+
n += step
9+
total += n
10+
count += 1
11+
if n >= SIZE * SIZE:
12+
break
13+
if count == 4:
14+
step += 2
15+
count = 0
16+
17+
print(total)

solutions/project-euler/028/out.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
669171001

solutions/project-euler/028/problem.md

Whitespace-only changes.

solutions/project-euler/028/tags.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
mathematics

0 commit comments

Comments
 (0)