0
$\begingroup$

I am generating some DifferenceRoot[Functions, but to apply RSolve to them, I'm just doing some cutting and pasting from the result. I assume there must be a more fluid/natural way to handle this.

Well, to use an example from the DifferenceRoot help page

PellNumber = 
DifferenceRoot[
Function[{y, n}, {-y[n] - 2 y[1 + n] + y[2 + n] == 0, y[0] == 0, 
 y[1] == 1}]];

I then entered

RSolve[PellNumber[[1]][[2]], \[FormalY][\[FormalN]], \[FormalN]]

which yielded

{{\[FormalY][\[FormalN]] -> -(((1 - Sqrt[2])^\[FormalN] - (1 + Sqrt[
   2])^\[FormalN])/(2 Sqrt[2]))}}

I considered posting this as an answer to the earlier version of the question (that is, the first paragraph), but the site is rather intimidating if one tries to do so - and I guess there might be an even more direct approach.

$\endgroup$
  • $\begingroup$ Please see my answer to an earlier question of yours. $\endgroup$ – bbgodfrey Nov 11 '16 at 3:45
  • $\begingroup$ Thanks, bbgodfrey for the earlier reference. It still isn't quite clear to me how if one generates a DifferenceRoot[Function, one can in the next command "feed" the result into RSolve. (I'm not very conversant with this First[Head[f]][y, n] sequence/usage.) $\endgroup$ – Paul B. Slater Nov 11 '16 at 14:39
  • $\begingroup$ OK--it seems that I can employ RSolve[First[Head[f]][y, n], y, n][[1, 1]], following the bbgodrey code. $\endgroup$ – Paul B. Slater Nov 12 '16 at 1:21