This example calls a C program to get 2d data for i/j repeating sequence lengths for primitive rationals within a specific part of the grid. The sequence length is shown both numerically and in color, and in the plot at right. Note that the sequence length is the same for all primitive rationals in a given row (i.e. that have the same denominator). Non-primitives have shorter sequences, with the lengths being those of their quanta (the equivalent rational closest to the 0/0 origin). Prime numbers can be easily identified as those rows (or columns) that contain all primitives (solid color) between the second column (or row) and the diagonal (e.g. 1, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29 in the top plot). The pattern of primitives-non-primitives in each row (or column) starting with a 0 in the first column (or row) repeats itself over and over beginning again at the diagonal (e.g. {0, 1, 0, 1} for 4/j or i/4, etc...)

©Copyright Sky Coyote, 2013.