### factor-group function

Posted:

**Sun Nov 25, 2018 9:45 am**To solve a project euler problem i have written this factor-group function:

Do you known a better/faster way?

Thanks.

cameyo

- Code: Select all
`(define (factor-group x)`

(letn (fattori (factor x)

unici (unique fattori))

(transpose (list unici (count unici fattori)))))

(factor-group 2000)

;-> ((2 4) (5 3))

(factor-group 232792560)

;-> ((2 4) (3 2) (5 1) (7 1) (11 1) (13 1) (17 1) (19 1))

Do you known a better/faster way?

Thanks.

cameyo