euler/python/e028.py

13 lines
300 B
Python

def euler_028():
total = 1
current_corner = 3
for n in range(3, 1002, 2):
total += 4 * current_corner + 6 * (n - 1)
current_corner += 4 * n - 2
return total
if __name__ == "__main__":
print("e028.py: {}".format(euler_028()))
assert(euler_028() == 669171001)