Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

discovering the law of quadratic reciprocity

Project: KOB1
Views: 128

Investigating the Legendre symbols (pq)(p|q), for primes pp and qq and discovering the Law of Quadratic Reciprocity

Plotting the legendre symbols (pq)(p|q), blue for +1+1, red for 1-1

N=200 pointsize = 16 G=Graphics() points =[(p,q) for p in primes(3,N) for q in primes(3,N) if not p == q] for x in points: if legendre_symbol(x[0],x[1])==1: G+=point(x, color='blue', size=pointsize) elif legendre_symbol(x[0],x[1])==-1: G+=point(x, color='red', size=pointsize)
G.show(figsize=10, aspect_ratio=1, axes_labels=['$p$','$q$'])

Comparing (pq)(p|q) with (qp)(q|p), unfilled circle for equal, filled circle for unequal

N=200 radius=1 G=Graphics() points =[(p,q) for q in primes(3,N) for p in primes(q,N) if not p == q] for x in points: l1 = legendre_symbol(x[0],x[1]) # (p|q) l2 = legendre_symbol(x[1],x[0]) # (q|p) if l1 == l2: G+=circle(x, radius, edgecolor='black', facecolor='black', thickness=1, fill=False) elif l1 == -l2: G+=circle(x, radius, edgecolor='black', facecolor='black', thickness=1, fill=True)
G.show(figsize = 10, aspect_ratio=1, axes_labels=['$p$','$q$'])

This plot reveals the Law of Quadratic Reciprocity (pq)={(qp), if pq3(mod4)(qp), otherwise (p|q) = \left \{ \begin{array}{rl} -(q|p), & \text{ if } p \equiv q \equiv 3 \pmod{4}\\ (q|p), &\text{ otherwise} \end{array}\right.