Re: Number of monomials

*To*: mathgroup at smc.vnet.net*Subject*: [mg87090] Re: Number of monomials*From*: Szabolcs Horvát <szhorvat at gmail.com>*Date*: Mon, 31 Mar 2008 02:06:28 -0500 (EST)*Organization*: University of Bergen*References*: <fsd6lf$9fn$1@smc.vnet.net> <fsg6rh$jae$1@smc.vnet.net> <200803280816.DAA04771@smc.vnet.net> <fsl28k$gak$1@smc.vnet.net> <fsnbeq$db2$1@smc.vnet.net>

Szabolcs Horvát wrote: > To count the number of terms in a sum, use e.g. > Length[{ Sequence@@sum }] Sorry, this is incorrect. I think that the only reliable way to count the number of terms in a sum is to explicitly check if there is only one or more terms. numOfTerms[terms_Plus] := Length[terms] numOfTerms[term_] := 1

**References**:**Re: Another stylesheet question***From:*Jerry <Jer75811@yahoo.com>