Friday, 30 March 2007

nt.number theory - Lagrange four-squares theorem: efficient algorithm with units modulo a prime?

I'm looking at algorithms to construct short paths in a particular Cayley graph defined in terms of quadratic residues. This has led me to consider a variant on Lagrange's four-squares theorem.



The Four Squares Theorem is simply that for any ninmathbbNninmathbbN, there exist w,x,y,zinmathbbNw,x,y,zinmathbbN such that
n=w2+x2+y2+z2.n=w2+x2+y2+z2.
Furthermore, using algorithms presented by Rabin and Shallit (which seem to be state-of-the-art), such decompositions of nn can be found in mathrmO(log4n)mathrmO(log4n) random time, or about mathrmO(log2n)mathrmO(log2n) random time if you don't mind depending on the ERH or allowing a finite but unknown number of instances with less-well-bounded running time.



I am considering a Cayley graph GNGN defined on the integers modulo NN, where two residues are adjacent if their difference is a "quadratic unit" (a multiplicative unit which is also quadratic residue) or the negation of one (so that the graph is undirected). Paths starting at zero in this graph correspond to decompositions of residues as sums of squares.



It can be shown that four squares do not always suffice; for instance, consider N=24N=24, where GNGN is the 24-cycle, corresponding to the fact that 1 is the only quadratic unit mod 24. However, finding decompositions of residues into "squares" can be helpful in finding paths in the graphs GNGN. The only caveat is that only squares which are relatively prime to the modulus are useable.



So, the question: let pp be prime, and ninmathbbZp(:=mathbbZ/pmathbbZ)ninmathbbZp(:=mathbbZ/pmathbbZ). Under what conditions can we efficiently discover multiplicative units w,x,y,zinmathbbZapstw,x,y,zinmathbbZapst such that n=w2+x2+y2+z2n=w2+x2+y2+z2? Is there a simple modification of Rabin and Shallit's algorithms which is helpful?



Edit: In retrospect, I should emphasize that my question is about efficiently finding such a decomposition, and for p>3p>3. Obviously for p=3p=3, only n=1n=1 has a solution. Less obviously, one may show that the equation is always solvable for ninmathbbZapstninmathbbZapst, for any p>3p>3 prime.

No comments:

Post a Comment