Re: May we trust IntegerQ ?
- To: mathgroup at smc.vnet.net
- Subject: [mg107499] Re: [mg107488] May we trust IntegerQ ?
- From: Artur <grafix at csl.pl>
- Date: Mon, 15 Feb 2010 05:45:33 -0500 (EST)
- References: <20100214094853.SERF5.402884.imail@eastrmwml37>
- Reply-to: grafix at csl.pl
Bob, I was used not advanced: aa = {}; Do[ If[PossibleZeroQ[ Round[N[ChebyshevT[x/2, x], 100]] - N[ChebyshevT[x/2, x], 100]], , AppendTo[aa, x]], {x, 0, 1500}]; aa which work always. Best wishes Artur Bob Hanlon pisze: > As stated in the documentation for IntegerQ: > > "IntegerQ[expr] returns False unless expr is manifestly an integer (i.e., has head Integer)." > > aa = {}; Do[If[IntegerQ[ChebyshevT[x/2, x]], , AppendTo[aa, x]], {x, 0, 20}]; > aa > > {3,5,7,9,11,13,15,17,19} > > Using FunctionExpand enables Mathematica to recognize the values for 7 and 17 as integers. > > aa = {}; Do[ > If[IntegerQ[FunctionExpand[ChebyshevT[x/2, x]]], , AppendTo[aa, x]], {x, 0, > 20}]; aa > > {3,5,9,11,13,15,19} > > Oddly, FullSimplify works for 7 but not 17. I had thought that FullSimplify would always try FunctionExpand. > > aa = {}; Do[ > If[IntegerQ[FullSimplify[ChebyshevT[x/2, x]]], , AppendTo[aa, x]], {x, 0, > 20}]; aa > > {3,5,9,11,13,15,17,19} > > > Bob Hanlon > > ---- Artur <grafix at csl.pl> 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 ? > > Best wishes > Artur > > >