MathGroup Archive 2003

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

Search the Archive

Re: Problem with NestWhileList

  • To: mathgroup at smc.vnet.net
  • Subject: [mg43676] Re: [mg43673] Problem with NestWhileList
  • From: Michael Williams <williams at vt.edu>
  • Date: Mon, 29 Sep 2003 01:47:53 -0400 (EDT)
  • References: <200309281001.GAA25672@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

The stop test must be a logical function of the iterate. !IntegerQ is a 
function with a pure function argument.  You want the composite.  Try   
!(IntegerQ[#])&    instead.  Or   Composition[Not,IntegerQ].

-mw
On Sep 28, 2003, at 6:01 AM, Robert G. Wilson v wrote:

> Hello all,
>
> 	I am working on the function f(x) = 3/2* Ceiling(x) and then counting 
> the number
> of iterations beginning with 2n+1 to reach an integer.
>
> 	Let me give an example. Beginning with 15 -> 45/2 -> 69/2 -> 105/2 -> 
> 159/2 ->
> 120. This means that it takes 5 'mapping' of the function, f, to reach 
> an integer.
> See http://www.research.att.com/projects/OEIS?Anum=A085058
>
> 	Question, How do I write this? I have tried:
> NestWhileList[3Ceiling[#1]/2 &, 15, !IntegerQ, {2, 10}] but all I get 
> is:
> {15, 45/2}.
>
> 	Any help would be greatly appreciated.
>
> Sincerely yours,
>
> Robert G. 'Bob' Wilson, V
>


  • Prev by Date: RE: start question
  • Next by Date: Re: start question
  • Previous by thread: Problem with NestWhileList
  • Next by thread: Re: Problem with NestWhileList