OFFSET
1,5
LINKS
Wikipedia, Quadratic reciprocity.
FORMULA
Triangle read by rows n-th row = the first p(n) - 1 terms of k^2 mod p(n) such that the next term 0 = and the cycle repeats. The 0 term and repeating cycle are not included in the triangle. 1<=k<=n.
EXAMPLE
First few rows of the triangle =
1;
1, 1
1, 4, 4, 1;
1, 4, 2, 2, 4, 1;
1, 4, 9, 5, 3, 3, 5, 9, 4, 1;
1, 4, 9, 3, 12, 10, 10, 12, 3, 9, 4, 1;
...
Row 3 = (1, 4, 4, 1) = the truncated cycle of (1, 4, 4, 1, 0, 1, 4, 4, 1, 0,...) = squares of (1, 2, 3,...) mod 5
MATHEMATICA
Table[ Mod[k^2, Prime@n], {n, 10}, {k, Prime@n - 1}] // Flatten (* Robert G. Wilson v, Aug 31 2008 *)
CROSSREFS
KEYWORD
nonn,tabf
AUTHOR
Gary W. Adamson, Aug 02 2008
STATUS
approved