Message Boards Message Boards

GROUPS:

Get symbolic expressions for summing sequences?

Posted 1 month ago
414 Views
|
12 Replies
|
7 Total Likes
|

Hello!

Let's say that I am having this sequence:

a(n) = 2*a(n-1) - a(n-2) + 2*a(n-3) + a(n-4) + a(n-5) - a(n-7) - a(n-8)

with a[1] == 1, a[2] == 1, a[3] == 1, a[4] == 2, a[5] == 6, a[6] == 14, a[7] == 28, a[8] == 56 as the base cases.

Now, I want to find the sum of a(1)^3 + a(2)^3 + .... + a(n)^3 SYMBOLICALLY, with respect to the first 8 base cases. There will be of course some cross terms ie. a(1)*a(2), etc, but it should be in terms of only the first 8 base cases.

I can use the RecurrenceTable and Total for finding numbers, but how can I do it symbolically and also simplify it to only the first 8 base cases?

Thank you very much in advance.

12 Replies

The function RSolve gives symbolic solutions to recurrence equations.

Posted 1 month ago

This is not what I need, though. There might not even exist a solution like that, I just want to simplify the sum a(1)^3 + a(2)^3 + ... + a(n)^3

First find a symbolic expression for a[k], then try Sum[a[k]^3,{k,1,n}], which may or may not give a closed symbolic output.

Posted 1 month ago

The Generating Function for your coefficients is

g[x_] := (x - x^2 - x^4)/(1 - 2 x + x^2 - 2 x^3 - x^4 - x^5 + x^7 + x^8)

Your coefficients then are obtained by (which is sort of a symbolic expression)

a[n_] := 1/n! Derivative[n][g][0]

e.g.

In[25]:=aa= a /@ Range[30]

Out[25]= {1, 1, 1, 2, 6, 14, 28, 56, 118, 254, 541, 1140, 2401, 5074, \
10738, 22711, 48001, 101447, 214446, 453355, 958395, 2025963, \
4282685, 9053286, 19138115, 40456779, 85522862, 180789396, 382176531, \
807895636}

But this as well gives only numerical values, which might be calculated quicker by recursion. As check

With[{n = 15},
 {aa[[n]],2 aa[[n - 1]] - aa[[n - 2]] + 2 aa[[n - 3]] + aa[[n - 4]] +    aa[[n - 5]] - aa[[n - 7]] - aa[[n - 8]]}]

Unfortunately that doesn't give a reasonable acces to a[n]^3 and its sum.

The Generating Function for your coefficients is

g[x_] := (x - x^2 - x^4)/(1 - 2 x + x^2 - 2 x^3 - x^4 - x^5 + x^7 + x^8)

Your coefficients then are obtained by (which is sort of a symbolic expression)

a[n_] := 1/n! Derivative[n][g][0]

e.g.

In[25]:=aa= a /@ Range[30]

Out[25]= {1, 1, 1, 2, 6, 14, 28, 56, 118, 254, 541, 1140, 2401, 5074, \
10738, 22711, 48001, 101447, 214446, 453355, 958395, 2025963, \
4282685, 9053286, 19138115, 40456779, 85522862, 180789396, 382176531, \
807895636}

But this as well gives only numerical values, which might be calculated quicker by recursion. As check

With[{n = 15},
 {aa[[n]],2 aa[[n - 1]] - aa[[n - 2]] + 2 aa[[n - 3]] + aa[[n - 4]] +    aa[[n - 5]] - aa[[n - 7]] - aa[[n - 8]]}]

Unfortunately that doesn't give a reasonable acces to a[n]^3 and its sum.

@Hans Dolhaine: Hello Hans,

this is a really nice result, I definitely like it! How did you get that?

FindGeneratingFunction[{1, 1, 1, 2, 6, 14, 28, 56}, x]

should do it, but does not give anything!

Regards -- Henrik

@Henrik

How did you get that?

First by paper and pencil following the procedures described in

https://www.amazon.de/s?k=herbert+wilf+generatingfunctionology&i=stripbooks&__mk_de_DE=%C3%85M%C3%85%C5%BD%C3%95%C3%91&ref=nb_sb_noss

Then I decided to make a procedure:

gF[k_] := ( a[1] x + Sum[   x^m (a[m] - Sum[c[j] a[m - j], {j, 1, m - 1}]), {m, 2, k}])/(
 1 - Sum[c[j] x^j, {j, 1, k}])

This is not quite the same as described in the book as it starts with a[1] x instead a[0].

Then with (the cc's are the coefficients in the recursion-formula)

cc = {c[1] -> 2, c[2] -> -1, c[3] -> 2, c[4] -> 1, c[5] -> 1,    c[6] -> 0, c[7] -> -1, c[8] -> -1};

and the initial values

r0 = {a[1] -> 1, a[2] -> 1, a[3] -> 1, a[4] -> 2, a[5] -> 6,    a[6] -> 14, a[7] -> 28, a[8] -> 56};

you get

In[4]:= gF[8] /. cc /. r0    
Out[4]= (x - x^2 - x^4)/(1 - 2 x + x^2 - 2 x^3 - x^4 - x^5 + x^7 + x^8 )

If you want more information or a notebook send me an email

h.dolhaine@gmx.de

Hello Hans,

many thanks for your reply with that interesting information!

I really wonder why FindGeneratingFunction is unable do solve that in that straightforward manner - lets hope for MMv12!

Best regards, liebe Gruesse -- Henrik

@Henrik

Ich finde Ihre Beiträge oft sehr interessant. Würden Sie mir Ihre email geben? Gehen Sie auch manchmal in die dmug?

LG HD

Posted 1 month ago

What about the following:

a[n_] := a[n] = 
  2 a[n - 1] - a[n - 1] + 2 a[n - 3] + a[n - 4] + a[n - 5] - 
   a[n - 7] - a[n - 8]
a[1] = a1;
a[2] = a2;
a[3] = a3;
a[4] = a4;
a[5] = a5;
a[6] = a6;
a[7] = a7;
a[8] = a8;

Then you can write:

Sum[a[k]^3, {k, 1, 10}] // Expand

Then you will have your expression. After that you can substitute the numbers for the a1, a2, ...

Good luck

Posted 1 month ago

This is what I finally did. Although it didn't solve the problem that I initially wanted to solve, it gave me an idea. Thanks!

This gives a symbolic output:

recEq = {a[n] == 
    2 a[n - 1] - a[n - 2] + 2 a[n - 3] + a[n - 4] + a[n - 5] - 
     a[n - 7] - a[n - 8]};
sol = RSolveValue[recEq, a, n]
Map[Sum[#, {k, 0, n}] &, Expand[sol[k]^3]]

The initial conditions are harder to apply.

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract