MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Integer

  • To: mathgroup at
  • Subject: [mg55788] Re: Integer
  • From: Bill Rowe <readnewsciv at>
  • Date: Wed, 6 Apr 2005 03:11:23 -0400 (EDT)
  • Sender: owner-wri-mathgroup at

On 4/5/05 at 3:21 AM, flashlight at (Daniel Arnold)

>How can I tell Mathematica that n is just an integer variable?

It would be helpful if you indicated how you are using n. A couple of possibilities come to mind.

One might be to create a function of n where n is an integer.

This could be done as


That is, I've defined f for integer values only. Any non-integer supplied to f will cause Mathematica to leave f as unevaluated since f is undefined for non-integer values.

Another might be in an expression. For example, Simplify[Sin[n Pi]] returns Sin[n Pi] since n could be any value. But Simplify[Sin[n Pi], Element[n, Integers]] returns 0 since Element[n, Integer] tells Mathematica n is an integer.
To reply via email subtract one hundred and four

  • Prev by Date: DirectedInfinity[1 + I], why does it get replaced by (1 + I)/(sqrt(2) ?
  • Next by Date: Re: Transpose to multiple lists
  • Previous by thread: Re: Integer
  • Next by thread: mathlink and cygwin