# Gauss Sum Walks

This Demonstration shows two types of pseudorandom walks constructed from Gauss sums, an exponential (red) and a quadratic residue (blue) Gauss walk. The random walk starts at the origin, takes steps given by the terms of the exponential or quadratic residue Gauss sum modulo , and ends at the value of the Gauss sum. By a famous result of Gauss, if the modulus is a prime number, the two walks always end at the same point, located at or depending on the remainder of modulo 4. The exponential Gauss walk has a characteristic shape consisting of two spirals. The quadratic residue Gauss walk exhibits a more complex behavior whose shape is roughly determined by the remainder of modulo 24.

### DETAILS

Given an integer , the exponential sum version of the Gauss sum modulo is defined by and the quadratic residue version is defined by ,
where is the Jacobi symbol, which has values 0, 1, depending on the quadratic residue properties of modulo .
A famous result of Gauss states that when the modulus is a prime , the two sums and have the same value , given by .
For composite moduli , the two sums are in general different, and the above formula does not necessarily hold.
It was shown by Lehmer  that the exponential Gauss walk always has the spiral-type shape observed in the visualization. On the other hand, the shape of the quadratic residue Gauss walk is more mysterious and has not been explored in the literature.
Reference
 D. H. Lehmer, "Incomplete Gauss Sums," Mathematika, 23(2), 1976 pp. 125–135. doi:10.1112/S0025579300008718.

### PERMANENT CITATION

 Share: Embed Interactive Demonstration New! Just copy and paste this snippet of JavaScript code into your website or blog to put the live Demonstration on your site. More details » Download Demonstration as CDF » Download Author Code »(preview ») Files require Wolfram CDF Player or Mathematica.

• Random Walk Solutions to the Dirichlet Problem for the Laplace EquationCameron Nachreiner
• Four Hypergeometric Lattice WalksBrad Klee
• Coupon Collector ProblemEd Pegg Jr
• Pseudorandom Walks with Generalized Gauss SumsKa Fung Tjin
• Partial Sums of a Lambert SeriesEnrique Zeleny
• Real Number Walks versus Algorithmic Random WalksKhoa Tran and Laila Zhexembay
• Random Walks and the Heat EquationYirui Luo
• Gauss MapEnrique Zeleny
• The Variance Gamma ProcessAndrzej Kozlowski
• Option Prices in the Variance Gamma ModelAndrzej Kozlowski