Re: problem with EvenQ
- To: mathgroup at smc.vnet.net
- Subject: [mg105941] Re: problem with EvenQ
- From: Emu <samuel.thomas.blake at gmail.com>
- Date: Sun, 27 Dec 2009 02:25:07 -0500 (EST)
- References: <hh68jn$bv4$1@smc.vnet.net>
On Dec 27, 11:09 am, dvholten <i... at dvholten.de> wrote:
> Hi folks,
> i puzzled all afternoon, but couldnt get this one solved:
> what is the proper way of using EvenQ[] within FindInstance[] ?
> I cant use it like
> FindInstance[ y*2 < 100 && EvenQ[y], {y}, Integers ]
> or even
> FindInstance[ EvenQ[y], {y}, Integers ]
>
> Actually, the expression used in FindInstance is much more complex,
> but i condensed the problem to be EvenQ[] - i expect some kind of
> special notation to help here.
>
> thanks
> dvh
It's better to use Mod.
In[1]:= FindInstance[y*2 < 100 && Mod[y, 2] == 0, {y}, Integers]
Out[1]= {{y -> 0}}
Sam