Re: Super-Increasing List
- To: mathgroup at smc.vnet.net
- Subject: [mg40456] Re: Super-Increasing List
- From: Bill Rowe <listuser at earthlink.net>
- Date: Sun, 6 Apr 2003 04:34:30 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
On 4/5/03 at 4:00 AM, flip_alpha at safebunch.com (flip) wrote:
>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}
SuperIncreasingQ[data_List] :=
And @@ Flatten[{OrderedQ[data],
MapThread[OrderedQ[{#1, #2}] &,
{Drop[FoldList[Plus, 0, data], -1], data}]}]
SuperIncreasingQ[list]
True
- Follow-Ups:
- Re: Re: Super-Increasing List
- From: Dr Bob <majort@cox-internet.com>
- Re: Re: Super-Increasing List