On Thu, 2007-07-26 at 13:10 -0700, Bill Hart wrote:
> 
> Perhaps if one had a fast way of evaluating the Dedekind sum, one
> might have a chance.
> 
> Bill.
> 

I think this gives a faster way to compute it:

Write the sum as 

s(h,k) = sum_{j=1}^{k-1} j/k [hj/k - floor(hj/k) - 1/2]

(This isn't strictly correct in general, but in our case hj/k will never
be an integer, so we are ok.)

Then if we separate this into three different sums and use some simple
summation formulas, we get

s(h,k) = h(k - 1)(2k - 1)/(6k) - (k-1)/4 - 
                        (1/k) sum_{j=1}^{k-1} j*floor(hj/k).

(To compute the floor in the inner sum, you can just use integer
division.)


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to