|
425 | 425 | (make-series n |
426 | 426 | 0 |
427 | 427 | cache |
| 428 | + n* |
428 | 429 | (if (zero? n) |
429 | 430 | `(exp ,(coeffs 0)) |
430 | 431 | (let* ([coeffs* (list->vector (map coeffs (range 1 (+ n 1))))] |
|
444 | 445 | (make-series n |
445 | 446 | 0 |
446 | 447 | cache |
447 | | - (if (zero? n) |
| 448 | + n* |
| 449 | + (if (zero? n*) |
448 | 450 | 0 |
449 | | - (let* ([coeffs* (list->vector (map coeffs (range 1 (+ n 1))))] |
450 | | - [nums (for/list ([i (in-range 1 (+ n 1))] |
| 451 | + (let* ([coeffs* (list->vector (map coeffs (range 1 (+ n* 1))))] |
| 452 | + [nums (for/list ([i (in-range 1 (+ n* 1))] |
451 | 453 | [coeff (in-vector coeffs*)] |
452 | 454 | #:unless (equal? (deref coeff) 0)) |
453 | 455 | i)]) |
454 | | - `(+ ,@(for/list ([p (all-partitions n (sort nums >))]) |
| 456 | + `(+ ,@(for/list ([p (all-partitions n* (sort nums >))]) |
455 | 457 | (if (= (modulo (apply + (map car p)) 2) 1) |
456 | 458 | `(* ,(if (= (modulo (apply + (map car p)) 4) 1) 1 -1) |
457 | 459 | ,@(for/list ([(count num) (in-dict p)]) |
|
465 | 467 | (make-series n |
466 | 468 | 0 |
467 | 469 | cache |
468 | | - (if (zero? n) |
| 470 | + n* |
| 471 | + (if (zero? n*) |
469 | 472 | 1 |
470 | | - (let* ([coeffs* (list->vector (map coeffs (range 1 (+ n 1))))] |
471 | | - [nums (for/list ([i (in-range 1 (+ n 1))] |
| 473 | + (let* ([coeffs* (list->vector (map coeffs (range 1 (+ n* 1))))] |
| 474 | + [nums (for/list ([i (in-range 1 (+ n* 1))] |
472 | 475 | [coeff (in-vector coeffs*)] |
473 | 476 | #:unless (equal? (deref coeff) 0)) |
474 | 477 | i)]) |
475 | | - `(+ ,@(for/list ([p (all-partitions n (sort nums >))]) |
| 478 | + `(+ ,@(for/list ([p (all-partitions n* (sort nums >))]) |
476 | 479 | (if (= (modulo (apply + (map car p)) 2) 0) |
477 | 480 | `(* ,(if (= (modulo (apply + (map car p)) 4) 0) 1 -1) |
478 | 481 | ,@(for/list ([(count num) (in-dict p)]) |
|
0 commit comments