simplification function for divsum



Hi,

I made a simplication function for divsum.
It works when second argument of divsum is 1.
I hope that someone will enjoy it.

Thanks,
-
Yuji

-------------- next part --------------
A non-text attachment was scrubbed...
Name: divsumsimp.mac
Type: image/mac
Size: 1344 bytes
Desc: not available
URL: <http://www.math.utexas.edu/pipermail/maxima/attachments/20110705/3972095c/attachment-0002.bin>;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rtest_divsumsimp.mac
Type: image/mac
Size: 1248 bytes
Desc: not available
URL: <http://www.math.utexas.edu/pipermail/maxima/attachments/20110705/3972095c/attachment-0003.bin>;
-------------- next part --------------


On 2011/07/02, at 10:54, ICHIKAWA, Yuji wrote:

> Fateman-san,
> 
> Thank you for your comments.
> I recognized that there is no reliable way to attach a condition for matching that involves 2 parameters in the match.
> 
> By the way, you can see a^b even if a, b are numbers, when you use a returned value of "factor".
> It works well in the first case, though you need to change divsum to noun in order to see the result.
> I think that the case of a*b is same.
> 
> Thanks,
> -
> Yuji
> 
> On 2011/07/02, at 9:18, Richard Fateman wrote:
> 
>> On 7/1/2011 5:12 PM, ICHIKAWA, Yuji wrote:
>>> 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
>>> _______________________________________________
>>> Maxima mailing list
>>> Maxima at math.utexas.edu
>>> http://www.math.utexas.edu/mailman/listinfo/maxima
>> a.   gcd(R,S) will be 1  if R and S are relatively prime.
>> b.   You will probably never see a*b in Maxima if a, b  are numbers. They will be multiplied together.
>> c.   You will probably never see a^b in Maxima if a, b are numbers, either.
>> d.   There is no reliable way to attach a condition for matching that involves 2 parameters in the match.
>> 
>> RJF
>> 
>