# Get symbolic expressions for summing sequences?

Posted 4 months ago
833 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, a == 1, a == 1, a == 2, a == 6, a == 14, a == 28, a == 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. Answer
12 Replies
Sort By:
Posted 4 months ago
 The function RSolve gives symbolic solutions to recurrence equations. Answer
Posted 4 months 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 Answer
Posted 4 months ago
 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. Answer
Posted 4 months 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] e.g. In:=aa= a /@ Range Out= {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. Answer
Posted 4 months 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] e.g. In:=aa= a /@ Range Out= {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. Answer
Posted 4 months ago
 @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 Answer
Posted 4 months ago
 @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 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 x instead a.Then with (the cc's are the coefficients in the recursion-formula) cc = {c -> 2, c -> -1, c -> 2, c -> 1, c -> 1, c -> 0, c -> -1, c -> -1}; and the initial values r0 = {a -> 1, a -> 1, a -> 1, a -> 2, a -> 6, a -> 14, a -> 28, a -> 56}; you get In:= gF /. cc /. r0 Out= (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 emailh.dolhaine@gmx.de Answer
Posted 4 months ago
 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 Answer
Posted 4 months ago
 @HenrikIch finde Ihre Beiträge oft sehr interessant. Würden Sie mir Ihre email geben? Gehen Sie auch manchmal in die dmug?LG HD Answer
Posted 4 months 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 = a1; a = a2; a = a3; a = a4; a = a5; a = a6; a = a7; a = 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 Answer
Posted 4 months 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! Answer
Posted 4 months ago
 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. Answer