ulam_spiral
    
    
    
      ulam_spiral,
      a MATLAB code which
      displays the integers as a spiral of grid cells, with the primes
      highlighted, so show that they tend to fall along diagonals,
      as discovered by Stanislaw Ulam.
    
    
      Licensing:
    
    
      The information on this web page is distributed under the MIT license.
    
    
      Languages:
    
    
      ulam_spiral is available in
      a MATLAB version and
      an Octave version and
      a Python version.
    
    
      Related Data and Programs:
    
    
      
      ulam_spiral_test
    
    
      
      matlab_plots,
      a MATLAB code which 
      uses plotting to illustrate a mathematical structure, such as
      an iterative map, a fractal, a curve or surface.
    
    
      Reference:
    
    
      
        - 
          Martin Gardner,
          Mathematical Games: The Remarkable Lore of the Prime Number,
          Scientific American,
          Volume 210, March 1964, pages 120-128.
         
        - 
          Martin Gardner,
          Sixth Book of Mathematical Diversion from Scientific American,
          ISBN13: 978-0-226-28250-3,
          University of Chicago Press, 1971.
         
        - 
          Christian Hill,
          The Ulam Spiral,
          https://scipython.com/blog/the-ulam-spiral/
         
        - 
          Cleve Moler,
          primespiral.m,
          Numerical Computing with MATLAB,
          SIAM, 2004,
          ISBN13: 978-0-898716-60-3,
          LC: QA297.M625,
          ebook: 
                            https://www.mathworks.com/moler/chapters.html
         
      
    
    
      Source Code:
    
    
      
        - 
          spiral_array.m,
          returns a 2t+1 x 2t+1 array of integers in a spiral.
        
 
        - 
          prime_spiral.m,
          returns a 2t+1 x 2t+1 array in which prime integers
          are represented by a value of 1.
        
 
      
    
    
    
      Last modified on 29 December 2022.