# What is the natural sequence of commands to apply RSolve to a DifferenceRoot[Function? [duplicate]

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.

• Please see my answer to an earlier question of yours. – bbgodfrey Nov 11 '16 at 3:45
• 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.) – Paul B. Slater Nov 11 '16 at 14:39
• OK--it seems that I can employ RSolve[First[Head[f]][y, n], y, n][[1, 1]], following the bbgodrey code. – Paul B. Slater Nov 12 '16 at 1:21