OFFSET
3,1
COMMENTS
Koshy, p. 499, states "We now employ this geometric approach to establish the lemma. It is due to the German mathematician Ferdinand Eisenstein, a student of Gauss at Berlin" (where the geometric lemma applies to the Law of Quadratic Reciprocity, Koshy, p. 501): "Let p and q be distinct odd primes. Then (p/q)(q/p) = (-1)^[(p-1)/2 * (q-1)/2]." Here (p/q) denotes the Legendre symbol.
REFERENCES
Thomas Koshy, "Elementary Number Theory with Applications", Harcourt Academic Press; 2002; pp. 498-500.
LINKS
FORMULA
a(n) = (prime(n-1) - 1) * (prime(n) - 1) / 4.
a(n) = Sum_{k=1..(p-1)/2} floor(k*q/p) + Sum_{k=1..(q-1)/2} floor(k*p/q).
EXAMPLE
Given the line y = (11/7)*x, the number of lattice points on or inside the rectangle formed by (1 <= y <= 5), (1 <= x <= 3), where p = 11, q = 7; 5 = (p-1)/2, 3 = (q-1)/2; 3*5 = 15.
The number of lattice points on or inside the rectangle, (below the line y = (11/7)*x = 8 = Sum_{k=1..(q-1)/2} floor(k*(11/7)) = floor(11*1/7) + floor(11*2/7) + floor(11*3/7) = 1 + 3 + 4 = 8. The number of lattice points on or inside the rectangle above the line y = (11/7)*x = Sum_{k=1..(p-1)/2} floor(k*(7/11)) = floor(7*1/11) + floor(7*2/11) + floor(7*3/11) + floor(7*4/11) + floor(7*5/11) = 0 + 1 + 1 + 2 + 3 = 7.
Total number of lattice points inside or on the rectangle = 8 + 7 = 15.
CROSSREFS
KEYWORD
nonn
AUTHOR
Gary W. Adamson, Sep 01 2003
EXTENSIONS
Corrected and extended by Ray Chandler, Sep 16 2003
STATUS
approved