Re: Re: Re: May we trust IntegerQ

• To: mathgroup at smc.vnet.net
• Subject: [mg107604] Re: [mg107582] Re: [mg107504] Re: [mg107488] May we trust IntegerQ
• From: Bob Hanlon <hanlonr at cox.net>
• Date: Fri, 19 Feb 2010 03:34:48 -0500 (EST)

```The issue would seem to be not whether you used Round[N[]] but rather whether you used it appropriately, i.e., conditionally.

f[x_] = (-1/2 (x - Sqrt[-1 + x^2])^(2 x) +
1/2 (x + Sqrt[-1 + x^2])^(2 x))^2;

If[FullSimplify[Element[f[#], Integers]],
Round[N[f[#]]], {#, "Failed"}] & /@ Range[0, 20] // Column

Bob Hanlon

---- Artur <grafix at csl.pl> wrote:

=============
Dear Bob,
Yes, I was see that Andrzej Kozlowski procedure work perfectly but
output is True/False type. I need procedure where output will be exact
integer number (and inside procedure will be not numerical functions
like Round[N[]]).
Your procedure realize this aim but only up to indexes 0..7 and not for
upper 8 and more.
Best wishes
Artur

Bob Hanlon pisze:
> As recommended by Andrzej Kozlowski in this thread, use Element to test
>
> And @@ Table[
>   FullSimplify[
>    Element[
>     (-1/2 (x - Sqrt[-1 + x^2])^(2 x) + 1/2 (x + Sqrt[-1 + x^2])^(2 x))^2,
>     Integers]],
>   {x, 0, 20}]
>
> True
>
>
> Bob Hanlon
>
> ---- Artur <grafix at csl.pl> wrote:
>
> =============
> Dear Bob,
> Your procedure do full simplify only up to index x=7 (and not from 8 and up)
>
> Table[FullSimplify[(-1/2 (x - Sqrt[-1 + x^2])^(2 x) +
>      1/2 (x + Sqrt[-1 + x^2])^(2 x))^2], {x, 0, 10}]
>
> Do you know what to do more ?
> Best wishes
> Artur
>
> Bob Hanlon pisze:
>
>> Use FullSimplify in this case
>>
>> Table[IntegerQ[
>>   FullSimplify[
>>    1/2 (x - Sqrt[-1 + x^2])^(2 x) + 1/2 (x + Sqrt[-1 + x^2])^(2 x)]], {x, 0,
>>   10}]
>>
>> {True,True,True,True,True,True,True,True,True,True,True}
>>
>>
>> Bob Hanlon
>>
>> ---- Artur <grafix at csl.pl> wrote:
>>
>> =============
>> Dear Daniel,
>> What to do in following case:
>> Table[IntegerQ[FunctionExpand[1/2 (x - Sqrt[-1 + x^2])^(2 x) + 1/2 (x +
>> Sqrt[-1 + x^2])^(2 x)]], {x, 0, 10}]
>> Best wishes
>> Artur
>>
>>
>> danl at wolfram.com pisze:
>>
>>
>>>> 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
>>>>
>>>> Best wishes
>>>> Artur
>>>>
>>>>
>>>>
>>> Trust IntegerQ? Mais oui.
>>>
>>>
>>> "IntegerQ[expr] returns False unless expr is manifestly an integer (i.e.,
>>>
>>> Example:
>>> In[16]:= IntegerQ[Sin[3]^2 + Cos[3]^2]
>>> Out[16]= False
>>>
>>> For your example, it might be better to use
>>> FunctionExpand[ChebyshevT[x/2,x]]. Then try to figure out which cases
>>> involving half-integer powers (Puiseux polynomials) will still evaluate to
>>> integers.
>>>
>>> Daniel Lichtblau
>>> Wolfram Research
>>>
>>>

```

• Prev by Date: Re: Re: Arctangent approximation
• Next by Date: Re: Re: (any documentation for) linear syntax?
• Previous by thread: Re: Nested list data extraction bottleneck
• Next by thread: Re: Re: Re: Re: May we trust IntegerQ