(define (filter-accumulate filter combiner null-value term a next b) ;de parameter filter bepaalt welke termen wegvallen (define (iter pos acc) (cond ((> pos b) acc) ((filter pos) (iter (next pos) acc)) (else (iter (next pos) (combiner acc (term pos))))) (iter a null-value)) (define (product-gcd n) (filter-accumulate (lambda (i) (<> (gcd i n) 1)) * 1 (lambda (x) x) 1 (lambda (x) (+ x 1)) n))