MathGroup Archive 2000

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

Search the Archive

Re: sum of recursive fn: solving for n

  • To: mathgroup at smc.vnet.net
  • Subject: [mg22146] Re: sum of recursive fn: solving for n
  • From: Brian Higgins <bghiggins at ucdavis.edu>
  • Date: Wed, 16 Feb 2000 02:35:10 -0500 (EST)
  • References: <888afd$c7p@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Fiona, Here is a brut force approach:

f[x_Integer] := f[x - 1]*2
f[0] = 2
solver[nmax_Integer, RHS_Integer] :=
  Do[If[Sum[f[x], {x, 1, n}] == RHS, Break[Print["n=" <> ToString[n]]]],
{n, 1, nmax}]
solver[10, 252]

n=6

Cheers, Brian





In article <888afd$c7p at smc.vnet.net>,
  fiona <reply at newsgroup.please> wrote:
>
> what am i doing wrong here?
>
> f[x_] := (f[x-1])*2
> f[1] =2
> Solve[Sum[f[x], {x, 1,n}] ==62, n]
>
> tia,
> fiona
>
>


Sent via Deja.com http://www.deja.com/
Before you buy.


  • Prev by Date: Setting up a probability problem
  • Next by Date: Ted Ersek's Tips and Luci's Mathematica & Economics Site have moved
  • Previous by thread: Re: Setting up a probability problem
  • Next by thread: Re: sum of recursive fn: solving for n