Ticket #6509 (closed enhancement: duplicate)

Opened 14 months ago

Last modified 14 months ago

sum of four squares function

Reported by: mhampton Owned by: somebody
Priority: minor Milestone: sage-duplicate/invalid/wontfix
Component: basic arithmetic Keywords:
Cc: Author(s):
Report Upstream: Reviewer(s): jsp
Merged in: Work issues:

Description

This can probably be improved, but its a first attempt that seems to work.

Attachments

trac_6509_four_squares.patch Download (3.2 KB) - added by mhampton 14 months ago.

Change History

Changed 14 months ago by mhampton

  • summary changed from sum of four squares function to [with patch, needs review] sum of four squares function

Changed 14 months ago by mhampton

Changed 14 months ago by mhampton

Oops, last one had a few mistakes. Current version is correct up to 10000 I think with the new "long" doctest.

Changed 14 months ago by jsp

  • reviewer changed from wstein to jsp
  • summary changed from [with patch, needs review] sum of four squares function to [with patch, positive review] sum of four squares function

Tested this with a lot of values taken from:  http://www.research.att.com/~njas/sequences/A006431

and usage of:

 http://www.alpertron.com.ar/FSQUARES.HTM

When we look at  http://www.research.att.com/~njas/sequences/A002635 we see that for instance 82 can be written in 7 ways as the sum of 4 squares. For more results see:  http://www.research.att.com/~njas/sequences/b002635.txt

So indeed this can be improved. But for now this is ok for a first attempt. Positive review.

Jaap

Changed 14 months ago by mvngu

  • status changed from new to closed
  • resolution set to duplicate
  • milestone changed from sage-4.1.1 to sage-duplicate/invalid/wontfix

This is a duplicate of ticket #6529. That ticket also incorporates the code contained in trac_6509_four_squares.patch.

Changed 14 months ago by mvngu

  • summary changed from [with patch, positive review] sum of four squares function to sum of four squares function
Note: See TracTickets for help on using tickets.