home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!rpi!masscomp!catfish!ocpt!tinton.ccur.com!cjh
- From: cjh@tinton.ccur.com (Christopher J. Henrich)
- Newsgroups: sci.math
- Subject: Re: Quadratic Residue Question
- Message-ID: <1992Jul20.190049.16274@tinton.ccur.com>
- Date: 20 Jul 92 19:00:49 GMT
- References: <1992Jul17.185526.26121@leela.cs.orst.edu> <1992Jul17.210332.2105@cs.umn.edu>
- Sender: news@tinton.ccur.com (News)
- Organization: Concurrent Computer Corp., Tinton Falls, NJ
- Lines: 65
-
- In article <1992Jul17.210332.2105@cs.umn.edu> pires@cs.umn.edu (Luiz S. Pires) writes:
- >
- >
- > Given an arbitrary number a and an odd prime p, I am trying to write a
- > subroutine that decides whether a is a quadratic residue mod p.
- >
- > I am familiar with a few of the rules available for manipulating the
- > "Legendre Symbol", including the law of quadratic reciprocity. However I
- > can't think of an efficient way for handling this problem in the general
- > case.
- > For example, if we have, say, a=31123 and p=45667, then I am not clear on
- > how to proceed.
-
- Besides the law of quadratic reciprocity, the key to this is
- the rule that
-
- / AB \ / A \ / B \
- | ---- | = | --- | * | --- | .
- \ P / \ P / \ P /
-
- And also, if C == D (mod P) then
-
- / C \ / D \
- | --- | = | --- |
- \ P / \ P /
-
- (*What* a notation! In the rest of this posting I will write
- LEG(C, P) etc.)
-
- To take up your example,
-
- LEG(31123, 45667) = - LEG(45667, 31123) by Q.R.
-
- = - LEG(14544, 31123) by second rule
-
- = - LEG(2**4 * 3**2 * 101, 31123) courtesy of
- "factor"
- = - LEG(101, 31123) by first rule
-
- = - LEG(31123, 101) by Q.R.
-
- = - LEG(35, 101) by second rule
-
- = - LEG(5, 101) * LEG(7, 101) by first rule
-
- = - LEG(101, 5) * LEG(101,7) by Q.R.
-
- = - LEG(1, 5) * LEG(3, 7) by second rule
-
- = - LEG(3,7) = LEG(7,3) = LEG(1,3) = 1.
-
- References on the number theory: I suppose most "first courses" will
- show you this; I know that Vinogradov's book does. Also
- refer to Hardy & Wright, which is a real encyclopedia of
- basic number theory.
-
- As a programming project, the difficult part is probably the
- factoring. But you can generalize the Legendre symbol to have
- a composite second argument, as long as thetwo arguments are
- relatively prime. I will stick my neck out and affirm that the'
- Q.R. formula is still true for the generalization.
-
- Regards,
- Chris Henrich
-