OFFSET
1,2
COMMENTS
Since the computation of the algorithm needs an extension of the integer part over a subset of C, the rule: floor(i*x) = i*floor(x) is used (which is what MuPAD does). The following program computes the exact value of the sum.
EXAMPLE
kappa(-1/sqrt(-105)) = -(1/210 + (1/210)i)*sqrt(105).
PROG
(MuPAD) kappa_neg_1_over_comp_sqrt := proc(n) local a, b, i, p; begin if (a := -sqrt(-n)+ceil(sqrt(-n))) = 0 then return(0) end_if: i := a := simplify(1/a, sqrt); p := 1; b := 0; repeat p := p*a; b := b*a+a-floor(a); until (a := simplify(1/(a-floor(a)), sqrt)) = i end_repeat: return(simplify(-(b/(p-1) + 1/a)/sqrt(-n), sqrt)); end_proc:
CROSSREFS
KEYWORD
nonn
AUTHOR
Thomas Baruchel, Sep 07 2003
STATUS
approved