Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8005001
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T17:05:32+00:00 2026-06-04T17:05:32+00:00

I have this recursive function: f(n) = 2 * f(n-1) + 3 * f(n-2)

  • 0

I have this recursive function:

f(n) = 2 * f(n-1) + 3 * f(n-2) + 4
f(1) = 2
f(2) = 8

I know from experience that explicit form of it would be:

f(n) = 3 ^ n - 1  // pow(3, n) - 1

I wanna know if there’s any way to prove that. I googled a bit, yet didn’t find anything simple to understand. I already know that generation functions probably solve it, they’re too complex, I’d rather not get into them. I’m looking for a simpler way.

P.S.
If it helps I remember something like this solved it:

f(n) = 2 * f(n-1) + 3 * f(n-2) + 4
// consider f(n) = x ^ n
x ^ n = 2 * x ^ (n-1) + 3 * x ^ (n-2) + 4

And then you somehow computed x that lead to explicit form of the recursive formula, yet I can’t quite remember

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T17:05:33+00:00Added an answer on June 4, 2026 at 5:05 pm
    f(n) = 2 * f(n-1) + 3 * f(n-2) + 4
    f(n+1) = 2 * f(n) + 3 * f(n-1) + 4
    
    f(n+1)-f(n) = 2 * f(n) - 2 * f(n-1) + 3 * f(n-1) - 3 * f(n-2)
    f(n+1) = 3 * f(n) + f(n-1) - 3 * f(n-2)
    

    Now the 4 is gone.
    As you said the next step is letting f(n) = x ^ n

    x^(n+1) = 3 * x^n + x^(n-1) - 3 * x^(n-2)
    

    divide by x^(n-2)

    x^3 = 3 * x^2 + x - 3
    x^3 - 3 * x^2 - x + 3 = 0
    

    factorise to find x

    (x-3)(x-1)(x+1) = 0
    x = -1 or 1 or 3
    
    f(n) = A * (-1)^n + B * 1^n + C * 3^n
    f(n) = A * (-1)^n + B + C * 3^n
    

    Now find A,B and C using the values you have

    f(1) = 2; f(2) = 8; f(3) = 26
    
    f(1) = 2 = -A + B + 3C
    f(2) = 8 = A + B + 9C
    f(3) = 26 = -A + B + 27C
    

    solving for A,B and C:

    f(3)-f(1) = 24 = 24C      => C = 1
    f(2)-f(1) = 6 = 2A + 6    => A = 0
    2 = B + 3                 => B = -1
    

    Finally

    f(n) = 3^n - 1
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have this recursive code <ul> <% sql=SELECT * FROM cats ORDER BY orderid
I have a function in java which is written with a recursive algorithm that
I have this recursive method which deletes empty folders: private void DeleteEmpty(DirectoryInfo directory) {
I have this recursive method: public Hund getMor(int id) { Hund barn = getHund(id);
I have moved this question to code review I've written a recursive descent parser
I have a recursive method like this: protected void executeAction( TreeItem ti ) {
I have a recursive data type like this: template<typename T> struct SomeType { std::map<T,
Imagine I have a recursive algebraic data type like this (Haskell syntax): data Expr
I have this application that will recurse all folders in a given directory and
I have a question on return and recursive functions. This is again based off

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.