Ulam spiral

Natural numbers are plotted on a spiral and the primes are marked: diagonals emerge.

You are now following this Submission

When the natural numbers are plotted in a spiral and the primes are marked, they tend to fall on diagonal lines.
(description from Galileo's Finger by Peter Atkins).

Cite As

Ebrahim Mousavi (2026). Ulam spiral (https://www.mathworks.com/matlabcentral/fileexchange/31850-ulam-spiral), MATLAB Central File Exchange. Retrieved .

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.0.0.0