#16308: Improve sums of squares
-------------------------------------+-------------------------------------
       Reporter:  jdemeyer           |        Owner:
           Type:  enhancement        |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-6.3
      Component:  number theory      |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  Jeroen Demeyer     |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/jdemeyer/ticket/16308            |  6b94a6576031e6e341143a4fc1fd83263a800ed9
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by pbruin):

 Replying to [comment:18 jdemeyer]:
 > Replying to [comment:14 leif]:
 > > I don't think anybody would expect e.g. `two_squares(25)` to return
 the trivial solution `(0,5)` instead of `(3,4)`.
 >
 > From a number-theory point of view, there is nothing wrong with `(0,5)`.
 In fact, in some cases, the only solution is the "trivial" one, for
 example for 9.
 I agree.  Given that 0 is a square, it makes complete sense to allow it as
 a term in a sum of squares.  That convention makes a lot of things nicer,
 for example:
 - every square is also a sum of two squares, and more generally every sum
 of ''k'' squares is also a sum of ''k'' + 1 squares;
 - ''n'' is a sum of 2 squares if and only if ''n'' can be factored non-
 trivially in '''Z'''[''i''];
 - ''n'' is a sum of ''k'' squares if and only if the lattice
 '''Z'''^''k''^ has a point of squared distance ''n'' from the origin.
 There are also nice formulae for the number of ways to write ''n'' as a
 sum of ''k'' squares if you interpret this number as the number of points
 (''x'',,1,, , ... , ''x'',,k,,) in '''Z'''^''k''^ with ''x'',,1,,^2^ + ...
 + ''x,,k,,''^2^ = ''n''.

--
Ticket URL: <http://trac.sagemath.org/ticket/16308#comment:22>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to