Re: variable declarations in mathematica?
- To: mathgroup at smc.vnet.net
- Subject: [mg7415] Re: [mg7373] variable declarations in mathematica?
- From: jpk at max.mpae.gwdg.de
- Date: Sat, 31 May 1997 15:07:24 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
> I'm trying to get Mathematica 3.0 to treat the variable n as an integer during
> simplification process. I spent several hours with the mathematica handbook,
but have not yet
> found the solution.
> What I want is to somehow DEFINE n as an integer so that for instance:
> Gamma[ n ] simplifies to: ( n - 1 )! or,
> ( 2 n - 1 )!!
> Gamma[ n + 1/2 ] simplifies to: ------------- . Sqrt[ Pi ]
> It cannot be hard...
> Bas ten Hoope
Hi here is one solution
First say n is an integer
Than say that Gamma[_?IntegerQ] is (n-1)! and add some rules for sums and
products of integers
IntegerQ[a_+b_]:=IntegerQ[a] && IntegerQ[b]
IntegerQ[a_*b_]:=IntegerQ[a] && IntegerQ[b]
Gamma[n] is simplifyed as You want.
Hope that helps
Prev by Date:
Fwd: List manipulation
Next by Date:
Re: PS printing problems: MMA V3.0 and Macs
Previous by thread:
Re: How to output matrix to file
Next by thread:
Plot Rotation solution