Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2012

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

Search the Archive

Re: recursion won't work for some reason

  • To: mathgroup at smc.vnet.net
  • Subject: [mg124841] Re: recursion won't work for some reason
  • From: Dana DeLouis <dana01 at me.com>
  • Date: Thu, 9 Feb 2012 05:37:18 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com

> Table[f[n], {n, 1, 30}]

Hi.  I see you have a solution with Set, and not Equal.

Just to mention an alternative to using Table.

data = {1 ,1 ,1 ,5 ,4 ,3 ,25 ,23 ,22 ,149 ,130 ,110};

k = {0 ,0 ,-1 ,0 ,0 ,21 ,0 ,0 ,69 ,0 ,0 ,64};

LinearRecurrence[k , data , 30]

{1 ,1 ,1 ,5 ,4 ,3 ,25 ,23 ,22 ,149 ,130 ,110 ,
785 ,693 ,623 ,4389 ,3880 ,3397 ,23977 ,
21115 ,18684 ,131893 ,116502 ,102680 ,
724705 ,638985 ,563949 ,3980357 ,3512812 ,3098935}

= = = = = = = = = = = = =
HTH :>)
Dana DeLouis
Mac & Math 8
= = = = = = = = = = = = =


On Feb 7 , 4:02 am, Roger Bagula <roger.bag... at gmail.com> wrote:
> This recursion is translated from a FindSequenceFunction[]:
> won't work in version 8?
> Clear[a, n]
> a[1] == 1; a[2] == 1; a[3] == 1; a[4] == 5; a[5] == 4; a[6] == 3;
> a[7] == 25; a[8] == 23; a[9] == 22; a[10] == 149; a[11] == 130;
> a[12] == 110;
> a[n_] := a[n] =
>   64* a[-12 + n] + 69 *a[-9 + n] + 21 *a[-6 + n] - a[-3 + n]
> Table[a[n], {n, 1, 30}]
> I actually have hundreds like this that work with no problems...from
> version 5 and before.
> The FindSequenceFunction is:
> f[n_] = FindSequenceFunction[{1, 1, 1, 5, 4, 3, 25, 23, 22, 149, 130,
>    110, 785, 693, 623, 4389, 3880, 3397, 23977, 21115, 18684, 131893,
>    116502, 102680, 724705, 638985, 563949, 3980357, 3512812, 3098935,
>    21873593, 19295871, 17024690, 120159701, 106019274, 93536946,
>    660211505, 582473085, 513900795, 3627162981, 3200166736,
>    2823410521, 19928207945, 17582033699, 15512135608, 109487029365,
>    96597344158, 85225004732, 601533119489, 530715145745,
>    468234819865}, n]
> Table[f[n], {n, 1, 30}]
> {1, 1, 1, 5, 4, 3, 25, 23, 22, 149, 130, 110, 785, 693, 623, 4389,
> 3880, 3397, 23977, 21115, 18684, 131893, 116502, 102680, 724705,
> 638985, 563949, 3980357, 3512812, 3098935}
> 
> The original sequence is a polynomial expansion:
> q[x_] = (-2 + 3 x - 8 x^3 + 8 x^4)
> f[x_] = ExpandAll[x^4*q[1/x]]
> a = Table[8^(1 + Floor[n/3])*SeriesCoefficient[
>           Series[1/f[x], {x, 0, 50}], n], {n, 0, 50}]
> 
> Any help that you can give will be appreciated.





  • Prev by Date: Re: Mathematica question
  • Next by Date: Re: Something other than PlotStyle to change look of graphs
  • Previous by thread: Re: recursion won't work for some reason
  • Next by thread: The simple command x=0;Dynamic[x=x+1]