Re: Re: sorting list of roots af a transcendental function
- To: mathgroup at smc.vnet.net
- Subject: [mg65294] Re: [mg65263] Re: sorting list of roots af a transcendental function
- From: Bob Hanlon <hanlonr at cox.net>
- Date: Fri, 24 Mar 2006 00:59:55 -0500 (EST)
- Reply-to: hanlonr at cox.net
- Sender: owner-wri-mathgroup at wolfram.com
{#[[1]], x/.#[[2]]}&/@
Select[
Table[{n, ToRules[
Reduce[x^3-x-Prime[n]==1, x, Integers]]},
{n, 1, 20}],
Length[#]==2&]
{{3, 2}, {9, 3}, {17, 4}}
Bob Hanlon
>
> From: Roger Bagula <rlbagulatftn at yahoo.com>
To: mathgroup at smc.vnet.net
> Subject: [mg65294] [mg65263] Re: sorting list of roots af a transcendental function
>
> Dule wrote:
> > Dear group,
> >
> > for calculating a model i need values for x which are given by the
> > transcendental function Cot[x] == x/a - a/(4*x). a is a parameter
0<a<200.
> > i obtained the roots with Table and FindRoot:
> > Table[FindRoot[Cot[x] == x/a - a/(4*x), {x, i}], {i, 1, 50}]]
> >
> > I have two questions:
> > 1. Is there a better way to do this?
> > 2. How can i construct a list, where the values for x, which appear
> > multiple are dropped?
> >
> > Thanks!
> >
>
> I have a similar question of my own:
> I want to get the weights where this equation has largest roots equal to
> integers:g^3-g-w[n]=0
> for prime weights:
> w[n]=Prime[n]
>
> b = Table[Table[x /. NSolve[x^3 - x - Prime[n] - 1 == 0.x][[m]], {m, 1,
> 3}], {n, 1, 10}]
> MatrixForm[b]
> c = Table[{n, Max[Table[Abs[x] /. Solve[x^3 - x -
> Prime[n] - 1 == 0.x][[m]], {m, 1, 3}]]}, {n, 1, 20}]
> ListPlot[c]
>
> This doersn't work: it doesn't see them as Integers:
> d = Flatten[Table[{n, If [IntegerQ[
> Max[Table[Abs[x] /.
> Solve[x^3 -
> x - Prime[n] - 1 == 0.x][[m]], {m, 1, 3}]]], Max[
> Table[Abs[x] /. Solve[x^3 - x - Prime[n] - 1 == 0.x][[
> m]], {m, 1, 3}]], {}]}, {n, 1, 20}], 1]
>
> That is in:
> {{1, 1.6717}, {2, 1.79632}, {3, 2.}, {4, 2.16631}, {5,
> 2.43484}, {6, 2.5483}, {7, 2.74784}, {8, 2.83714}, {9,
> 3.}, {10, 3.21447}, {11, 3.27976}, {12, 3.4611}, {13,
> 3.5719}, {14, 3.62475}, {15, 3.72594}, {16, 3.86794}, {
> 17, 4.}, {18, 4.0421}, {19, 4.16331}, {20, 4.24028}}
>
> I want output ( integer weights separated out):
> { {3, 2}, {9, 3}, {17, 4}}
>
>