Re: Super-Increasing List
- To: mathgroup at smc.vnet.net
- Subject: [mg40459] Re: [mg40438] Super-Increasing List
- From: Dr Bob <majort at cox-internet.com>
- Date: Sun, 6 Apr 2003 04:35:03 -0400 (EDT)
- References: <200304050900.EAA16245@smc.vnet.net>
- Reply-to: majort at cox-internet.com
- Sender: owner-wri-mathgroup at wolfram.com
superIncreasing[t_List] :=
Catch[
Fold[If[And @@ Thread[#1 < #2], #2 + #1{1, 0}, Throw[False]] &,
{1, 1}First@t, Rest@t]; True]
Bobby
On Sat, 5 Apr 2003 04:00:35 -0500 (EST), flip <flip_alpha at safebunch.com>
wrote:
> Hello,
>
> does a command or module exist which can test a list of values and
> determine
> if it is a super-increasing list?
>
> A super-increasing list satifies the conditions:
>
> a. the list is in increasing order
> b. each element of the list is greater than the sum of it's previous
> elements
>
> Example:
>
> list = {2, 3, 7, 15, 31}
>
> So check:
>
> a. It is in increasing order and
> b. 3 > 2, 7 > 3+ 2, 15 > 7 + 3 + 2 and 31 > 15 + 7 + 3 + 2,
>
> hence the list is super-increasing.
>
> Thanks for any inputs, Flip
>
> To email me, remove "_alpha".
>
>
>
>
--
majort at cox-internet.com
Bobby R. Treat
- References:
- Super-Increasing List
- From: "flip" <flip_alpha@safebunch.com>
- Super-Increasing List