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).