Let us assume that $k$, $f(1)$, and $f(0)$ are constants. I am trying to find a closed form expression for $f(a)$, $a &gt;= 2$ in terms of $k$, $f(1)$, and $f(0)$. I have to tried to recursively substitute values for $f(a)$ to try and generate a pattern. \begin{eqnarray} f(2) &amp;=&amp; k f(1) - f(0) \newline f(3) &amp;=&amp; (k^{2}-1) f(1) - k f(0) \newline f(4) &amp;=&amp; k(k^{2}-3) f(1) - (k^{2}-1) f(0) \newline f(5) &amp;=&amp; (k^{4}-3k^{2}+1) f(1) - k(k^{2}-2) f(0) \end{eqnarray} However, this is perhaps not the right way to approach this problem, and I'm looking for alternative ways to solve it?
Given a recurrence relation:   $$ x_{n+2} = px_{n+1} + qx_n + r $$   Find the general term $x_n$ given initial conditions $x_1 = a$ and $x_2 = b$, where $a,b,p,q,r$ are some given numbers, $n \in \mathbb N$.   Since this is a non-homogeneous linear recurrence relation i've started with solving for $x_n^h$ which is a solution for homogeneous relation:  $$ x_{n+2} - px_{n+1} - qx_n = 0 \\ \lambda^2-p\lambda - q = 0 $$  I'm assuming here that two distinct roots $\lambda_{1,2}$ exist for this equation (single root case is handled similarly). So the general term is in the form:  $$ x_n = C_1\lambda_1^{n-1}+C_2\lambda_2^{n-1} $$  With the initial condition it's possible to find the values for $C_1$ and $C_2$:  $$ C_1 + C_2 = a \\ C_1\lambda_1 + C_2\lambda_2 = b $$  After solving the system of equation with respect to $C_1$ and $C_2$:  $$ C_1 = \frac{b-a\lambda_2}{\lambda_1 - \lambda_2} \\ C_2 = \frac{b-a\lambda_1}{\lambda_2 - \lambda_1} \\ $$  Which eventually results in:  $$ x_n^h = \frac{(a\lambda_2 - b)\lambda_1^{n-1} - (a\lambda_1-b)\lambda_2^{n-1}}{\lambda_2 - \lambda_1} $$  Final solution consists of a sum of particular and homogeneous solutions, but that is where I got stuck. What is the way to find the particular solution for the given problem? I'm pretty new to such kind of problems so any details are very much appreciated.  upd:  Based on the technique in @rtybase answer here are my findings:  $$ \begin{align} x_1 &amp;= a \\ x_2 &amp;= b \\ x_3 &amp;= pb - qa + r \end{align} $$  Writing the system for $c_1, c_2, c_3$:  $$ \begin{align} a &amp;= c_1 + c_2 + c_3 \\ b &amp;= c_1\lambda_1 + c_2\lambda_2 + c_3 \\ pb+qa+r &amp;= c_1\lambda_1^2 + c_2\lambda_2^2 + c_3 \end{align} $$  Now solving for the coefficients gives a huge formula. The answer to this problem suggests that:  $$ x_n = \frac{(\lambda_2(a+\gamma) - b -\gamma)\lambda_1^{n-1} - (\lambda_1(a + \gamma) - (b-\gamma))\lambda_2^{n-1}}{\lambda_2 - \lambda_1} - \gamma $$  Where:  $$ \gamma = \frac{r}{p+q-1} $$  Unfortunately I was not able to arrive at exactly the same result, but testing my solution (not posting since it's monstrously big) using SameQ in Mathematica with the given answer shows that they are equivalent. Those transformations are not very obvious to me, so i skipped them since the answer matches the given one (yet the symbolic expressions are different)
Could you help me to point out the differences in the following sentences. for me both sentences imply same meaning.      The Restaurant , offers a broad range of locally caught fresh seafood,   prime steak and meat dishes      The Restaurant , offers a wide range of locally caught fresh seafood,   prime steak and meat dishes Why doesn't the T-800 run? I just re-watched the first two films in the Terminator series. The T1000 (Robert Patrick) does a lot of running, and is quite fast.  I didn't see many scenes where the T800 (Arnie) ran. Is it because he's really heavy? Is he mainly designed as a heavy "stand your ground" machine?  The only scene I could see him running is in T2 in the mental hostpital where the T1000 morphs through the metal gate and his gun gets caught. Then the T800 does a little jog to get into the elevator following John and Sarah. (anybody know of any other running/jogging scenes?) (EDIT Arnie also breaks into a run while pursuing Reece and Sarah down the alley after the NOIR nightclub attack.)  If he can at least jog though, why wouldn't he do this throughout the entire film? You would think that from a "chance of survival" point of view, if he could get a John even the slightest bit faster then he'd do so.  Of course, maybe I am overthinking this... Arnie walking around slowly is a lot more badass than Arnie jogging around.  Edit: Just watched T3 again, the T800 also ran towards the end when the big hangar door was closing and he ran over to slow it down. Interested in other examples of the T800 running too. Outline around text on CMYK black background in Photoshop I'm trying to make a document with one color black  (c:0,m:0,y:0,k:100) background with red text on it. However in CMYK the text has this weird grey white-ish edge. In RGB it doesn't show but in CMYK it shows. I'm wondering will this show when printing or do I need to use different methods? ie. using rich black etc.  Here's the RGB and CMYK comparison Is there any way to script Windows 10's "color filter" feature programmatically? Is there a way to kill a process tree using the terminal?  By killing a process tree, I mean killing all descendants of a process along with the process it self.  I tagged this question htop because I am using that utility a lot these days and it would be cool if there was an easy way to kill a process tree inside htop (something better than just selecting all the processes in the subtree). Why are "baked" and "naked" not pronounced the same? How to implement Enums in Ruby? What's the best way to implement the enum idiom in Ruby? I'm looking for something which I can use (almost) like the Java/C# enums. counting proof for $\sum_{k=0}^{n-1} 2^{k} = 2^n - 1$ I was hoping someone could help me come up with a combinatorial proof, one with an easy to understand 'story' for $\sum_{k=0}^{n-1} 2^{k} = 2^n - 1$. For instance I understand that $2^n$ is the number of possibilities when creating subsets of size $n$. For example, if you're given a choice of any topping on a pizza, and you can only have said topping once (decide to include or exclude) then you have $2^n$ choices. But I'm not sure how the $-1 $ would be incorporated, or why the LHS would be $1+2+4+8+...+2^{n-1}$ Give an example about limits: $\lim\limits_{x\to0}f(x^{2})$ exists but $\lim\limits_{x\to0}f(x)$ does not. Agreement in "[Singular Noun] Is/Are [Plural Noun]"? PHP preg_match (.*) not matching past line breaks How do I install a different Python version using apt-get? Book about a boy who travels to a parallel universe to get a book By $A\oplus B$ we denote the symmectric difference of two sets. The definition is $A\oplus B =(A\setminus B) \cup (B\setminus A)$. Now I hope to show that $A\oplus (B\oplus C) = (A\oplus B)\oplus C$. I remember that there's an elegant proof, but I forget its detail. (The first step is to show $A\oplus (A\oplus B) = B$, and maybe applying this formula, we can obtain associativity.) How to accomplish SQL Server 2012+2014 high availability Maybe I'm searching for the wrong thing, but I can't see how I can do this.  I have two servers:   Server A (has SQL Server 2012 installed) Server B (has SQL Server 2014 installed)   Server A provides an API via IIS. The code both inserts and gets data from the database depending on the API call.  Server B does exactly the same for its local database.  I would like to have it so that the two databases are consistent copies of each other. I do believe this is what HA accomplishes.   So a load balancer, for example, might direct API calls to A sometimes, and B sometimes, but the data needs to be consistent either way.  I found some documentation on HA for SQL Server 2012, but not on how to do this for a mixed environment of 2012 and 2014.  Any help or pointers to documentation would be great! Thanks. Why aren't Christoffel symbols tensors? - asked from a fibre bundle perspective Expected value of sums Suppose we draw cards out of a deck without replacement. How many cards do we expect to draw out before we get an ace? Homotopic maps have homotopy equivalent mapping cones How should I structure my URLs for both SEO and localization? When I set up a site in multiple languages, how should I set up my URLs for search engines and usability?  Let's say my site is www.example.com, and I'm translating into French and Spanish. What is best for usability and SEO?  Directory option:  http://www.example.com/sample.html http://www.example.com/fr/sample.html http://www.example.com/es/sample.html   Subdomain option:  http://www.example.com/sample.html http://fr.example.com/sample.html http://es.example.com/sample.html   Filename option:  http://www.example.com/sample.html http://www.example.com/sample.fr.html http://www.example.com/sample.es.html   Accept-Language header:  Or should I simply parse the  header and generate content server-side to suit that header?  Is there another way to do this? If the different language versions don't have different urls, what do I do about the search engines?    UPDATE 2011-12-06  Google has new recommendations for meta tags for explicitly pointing to other language content: .  UPDATE 2012-05-25  Related but not precisely:   UPDATE 2013-06-12  includes discussion of several URL schemes directly relevant to the question. Access denied for user 'root@localhost' (using password:NO)