Mod Fill Visualizer

The m-th column of this triangular diagram (reading left to right) has m cells (lowest is 0, highest is m-1), which are colored each time the corresponding residue modulo m occurs for some entry of the sequence. The sequence terms a(n) are considered in order, filling the corresponding cells in turn, so you can get an idea of when various residues occur by watching the order the cells are filled in as the diagram is drawn. You specify how to compute the color used for filling each cell with the formula in the Fill color option.

Parameters

  • Highest modulus: The number of columns to display, which corresponds to the largest modulus to consider.
  • Background color: The color of the background
  • Fill color: A formula which computes the color used to fill each cell as it is drawn. See the Chroma documentation for ways to specify colors in a formula. The formula may use any of the following variables, the values of which will be predefined for you:
    • a, the current entry of the sequence,
    • n, the current index in the sequence,
    • m, the modulus represented by the current cell.

To recover the residue of the current cell being filled, use the expression a % m.

  • Square canvas: If true, force canvas to be aspect ratio 1 (square). Defaults to false.
  • Sunzi mode: Warning: can create a stroboscopic effect. If true, the background is redrawn on every frame. If the background color is opaque or nearly so, this mode creates a stroboscopic effect in which only the residues of the current sequence element are visible in each frame. (It can help to turn down the Frame rate if the visual effect is too jarring.) If the opacity of the background is roughly 0.05, turning on the Sunzi mode has a "history fading effect," in that the contribution of long past terms fades into the background. This parameter is named for Sunzi's Theorem (also known as the Chinese Remainder Theorem).
  • Frame rate: Entries displayed per second. Can be useful in combination with Sunzi mode. Only visible when Sunzi mode is true.