MathGroup Archive 2010

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

Search the Archive

Re: May we trust IntegerQ ?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg107498] Re: [mg107488] May we trust IntegerQ ?
  • From: Patrick Scheibe <pscheibe at trm.uni-leipzig.de>
  • Date: Mon, 15 Feb 2010 05:45:22 -0500 (EST)
  • References: <201002141316.IAA02260@smc.vnet.net>

Hi,

should you *use* IntegerQ here? NO! Because it's maybe not what you
want:

IntegerQ[1.0]

If the CheychevT does not simplify to an exact integer you will never
get true for IntegerQ.

Maybe you want to know whether your numbers are really close to an
integer?

Select[Range[20], 
 With[{num = N[ChebyshevT[#/2, #]]}, 
   Abs[num - IntegerPart[num]] > 10^-8] &]

Cheers
Patrick

On Sun, 2010-02-14 at 08:16 -0500, 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 ?
> 
> Best wishes
> Artur
> 
> 
> 
> 



  • Prev by Date: Re: When can Mathematica have a decent Find dialogue?
  • Next by Date: PolarPlot in dB
  • Previous by thread: May we trust IntegerQ ?
  • Next by thread: Re: May we trust IntegerQ ?