MathGroup Archive 2008

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

Search the Archive

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


  • Prev by Date: Re: Number of monominals
  • Next by Date: FW: Minimum width of Button[.] on different platforms
  • Previous by thread: Re: Number of monomials
  • Next by thread: Re: Re: Another stylesheet question