TransWikia.com

RSolve problem not working

Mathematica Asked on June 5, 2021

I tried to use Mathematica to find $a_{n}$. But unfortunately, it returned a equation that I can’t understand. Here is the code below.

eqn = RSolve[
   a[n + 1] == a[n] + a[n - 2] && a[2] == 1 && a[3] == 2 && a[4] == 3,
    a, n];
Table[a[n] /. First[eqn], {n, 1, 13}]

One Answer

Try:

eqn = RSolve[
a[n + 1] == a[n] + a[n - 2] && a[2] == 1 && a[3] == 2 && a[4] == 3,
a, n];
Table[a[n] /. First[eqn], {n, 1, 13}] // Re // N // Rationalize

(*{1, 1, 2, 3, 4, 6, 9, 13, 19, 28, 41, 60, 88}*)

You can try:

 RSolve[a[n + 1] == a[n] + a[n - 2] && a[2] == 1 && a[3] == 2 && 
 a[4] == 3, a[n], n] // ToRadicals

 (*{{a[n] -> (1/3 - 1/6 (1 - I Sqrt[3]) (29/2 - (3 Sqrt[93])/2)^(1/3) - 
   1/6 (1 + I Sqrt[3]) (1/2 (29 + 3 Sqrt[93]))^(1/3))^
 n (1/3 - 
   1/186 (1 + I Sqrt[3]) (3844 - 372 Sqrt[93])^(
    1/3) - ((1 - I Sqrt[3]) (1/2 (31 + 3 Sqrt[93]))^(1/3))/(
   3 31^(2/3))) + (1/3 - 
   1/6 (1 + I Sqrt[3]) (29/2 - (3 Sqrt[93])/2)^(1/3) - 
   1/6 (1 - I Sqrt[3]) (1/2 (29 + 3 Sqrt[93]))^(1/3))^
 n (1/3 - 
   1/186 (1 - I Sqrt[3]) (3844 - 372 Sqrt[93])^(
    1/3) - ((1 + I Sqrt[3]) (1/2 (31 + 3 Sqrt[93]))^(1/3))/(
   3 31^(2/3))) + 
1/31 3^(-1 - 
  n) (1 + (29/2 - (3 Sqrt[93])/2)^(
   1/3) + (1/2 (29 + 3 Sqrt[93]))^(1/3))^
 n (31 + (3844 - 372 Sqrt[93])^(1/3) + 
   2^(2/3) (31 (31 + 3 Sqrt[93]))^(1/3))}}*)

For more info execute: ?Root and ?ToRadicals

Answered by Mariusz Iwaniuk on June 5, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP