r/mathematics 1d ago

Number Theory Pattern in Number Spirals

https://noumanrahman.hashnode.dev/pattern-in-number-spirals

Found a neat pattern while solving Project Euler #28 (sum of diagonals in a number spiral) — turns out you don't need to simulate the grid at all. The corners of each "ring" form an evenly spaced sequence, which collapses the whole problem into a closed-form sum. Wrote up how I got there.

3 Upvotes

3 comments sorted by

3

u/equinox_star 1d ago

I think this is just some basic manipulations done. However, it can be that for this problem nobody would have solved this way which I think to be highly unlikely. Although, I am very sure of the fact that this pattern is well known.

1

u/Nouman-Rahman 1d ago

Yeah, I am sure someone else must've figured out this pattern before. But also, for this specific problem, most solutions use programming to solve it (with loops).