How can I add simplification rule depending relation between two factors?



Hi,

I am trying to make simplification rules for divisor function divsum.

1. divsum(p^n) = (p^(n+1)-1)/(p-1) when p is prime.
defrule was great to implement this rule though I was happier if there is a feature of "prime".

(example)
matchdeclare(pp, primep, nn, lambda([x], (integerp(x) or featurep(x, integer)) and x > 0))$
defrule(sigma_simp1, divsum(pp^nn, 1), (pp^(nn + 1) - 1)/(pp - 1))$

declare(n, integer)$
assume(n > 0)$
sigma_simp1(divsum(3^n));
=> (3^(n+1)-1)/2

2. divsum(a*b) = divsum(a)*divsum(b) if a and b are relatively prime.

I lost my way for this simplification.
Are there any manners to let Maxima check if two variables are relatively prime?

Thanks,
-
Yuji