Re: May we trust IntegerQ ?
- To: mathgroup at smc.vnet.net
- Subject: [mg107503] Re: May we trust IntegerQ ?
- From: Bill Rowe <readnews at sbcglobal.net>
- Date: Mon, 15 Feb 2010 05:46:16 -0500 (EST)
On 2/14/10 at 8:16 AM, grafix at csl.pl (Artur) wrote: >Procedure: find such x that ChebyshevT[x/2, x] isn't integer aa = >{}; Do[ If[IntegerQ[ChebyshevT[x/2, x]], , AppendTo[aa, x]], {x, 0, >20}]; aa and answer Mathematica is set: {3, 5, 7, 9, 11, 13, 15, 17, >19} where occered e.g. number 7 N[ChebyshevT[7/2, 7],100] >5042. >00000000000000000000000000000000000000000000000000000000000000000\ >0000000000000000000000000000000 evidently is integer 5042 Some >comments ? Per the documentation for IntegerQ, False is returned whenever the argument is not manifestly an integer, i.e., has head Integer. So, any expression that doesn't quickly evaluate to an integer will be considered a non-Integer by IntegerQ regardless of whether or not it would evaluate to an integer. Recognizing this and eliminating the AppendTo, the code below returns cases where ChebyshevT[x/2,x] is a non-integer In[11]:= Last@ Reap[If[! IntegerQ@FullSimplify@ChebyshevT[#/2, #], Sow[#]] & /@ Range[20]] Out[11]= {{3, 5, 9, 11, 13, 15, 17, 19}}