Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1992
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1992

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

Search the Archive

Re: Even numbers

  • To: mathgroup at yoda.physics.unc.edu
  • Subject: Re: Even numbers
  • From: a_rubin at dsg4.dse.beckman.com (arthur rubin)
  • Date: Fri, 10 Jul 92 07:46:21 PDT

You (martind at puhep1.princeton.edu) write:

  I'd like to know how to set up that a certain "number" 2*k is even
while 2*k+1 is odd, in such a way that then 

 EvenQ[2*k]=True

 OddQ[2*k+1]=True

 I know that with upvalues it is possible to set up that a single symbol
is even:

 n /:EvenQ[n]=True   

but it does not work with the "expression" 2*k.

----------------------------------------------------------
You have to unprotect EvenQ and OddQ (for downvalues) or Plus and Times
(for upvalues).





  • Prev by Date: Contour Plots for cylindrical coordinates
  • Next by Date: Re: Recursion relation
  • Previous by thread: Contour Plots for cylindrical coordinates
  • Next by thread: teaching