Re: [racket] q about code for partitions

2014-06-04 Thread Neil Toronto
On 06/04/2014 12:36 PM, Jos Koot wrote: Hi In share/pkgs/math-lib/math/private/number-theory I find the following two pieces of code: line 34: (define m (/ (+ 1.0 (flsqrt (+ 1.0 (* 24.0 n 6.0)) line 39: (exact-floor m) Obviously for finding the positive root of the equation n-k(3k-1)/2=0 f

[racket] q about code for partitions

2014-06-04 Thread Jos Koot
Hi In share/pkgs/math-lib/math/private/number-theory I find the following two pieces of code: line 34: (define m (/ (+ 1.0 (flsqrt (+ 1.0 (* 24.0 n 6.0)) line 39: (exact-floor m) Obviously for finding the positive root of the equation n-k(3k-1)/2=0 for k in terms of n. (from wikipedia: http: