
Content Writer
Recursive Function is one of the most common functions or expressions used in mathematics. A recursive function is an expression which expresses a series of functions by repetitively using its previous terms.
- Recursive Function is based on the principle of arithmetic and geometric sequence.
- While calculating the function, two cases are considered, namely the base case and the recursive case.
- It is also known as a computable function.
- Recursive Function solves a problem while solving smaller cases of similar problems.
- It can be written for both arithmetic and geometric functions.
- The method is suitable for divide-and-conquer algorithms like merge and sort.
- It is used to solve mathematical problems like factorial of a number and generation of fibonacci series.
Read More: Factorial Formula
Key Terms: Recursive Function, Arithmetic Function, Geometric Function, Sequences, Factorial, Fibonacci Series, Algorithms, Java, Python
What is Recursive Function?
[Click Here for Sample Questions]
A recursive Function is a function that will call itself directly or indirectly to solve a problem. The word recursive means anything which is reoccurring, that is repeating itself. It is based on the value of more than one variable.
- As the name suggests, a recursive function is used to calculate a function's value.
- There are two types of recursive function formulas, namely direct recursion and indirect recursion.
- For example, you have a measuring cylinder.
- Now you, add 1 ml of water to make it 2 ml.
- Then, you add another ml of water to it.
- Similarly, the entire procedure continues till the desired volume.
- Thus, here, the base value, 1ml, kept recurring.
Read More: Difference between Variables and Constants
Types of Recursive Function
[Click Here for Sample Questions]
The two types of recursive function formulas are as follows:
Arithmetic Functions
Arithmetic functions are characterized by a common difference between the subsequent terms. The recursive formula for an arithmetic function having sequence f1, f2, f3, ….fn can be written as:
fn = fn-1 + d
How to calculate the recursive function?
The process to calculate the recursive functions using the arithmetic functions are as follows:
- First determine the common difference d.
- State the first term.
- Create the formula of the previous term + common difference.
For Geometric Functions
Geometric functions are characterized by a common ratio between the subsequent terms. The recursive formula for a geometric function can be written as:
fn = r. fn-1
How to calculate the recursive function?
The process to calculate the recursive functions using the geometric functions are as follows:
- First determine the common ratio r.
- Next, state the first term.
- Then create the formula to be the previous term x common ratio.
Read Also:
Solved Examples of Recursive FunctionsGiven below are some examples of recursive functions. Example 1. Let a1= 5 and an = 2an-1 + 1. Determine the value of a4. Ans. Given a1 = 5
Example 2. Let a1= 2 and an = 5. an-1. Determine the value of a4. Ans. Given a1 = 2
Read More: Complex Numbers and Quadratic Equations Example 3. Let a1= 10 and an = an-1 + 10. Determine the value of a5. Ans. Given a1 = 10
Example 4. Let a0= 1 and an = 5. nan-1. Determine the value of a3. Ans. Given a0= 1
Read More: Types of Relation |
Things to Remember
[Click Here for Sample Questions]
- A recursive function is an expression which expresses a series of functions by repetitively using its previous terms.
- It can be written for both arithmetic and geometric functions.
- A recursive function is highly used in mathematics.
- It is also used in computer programming languages, such as C++, Java, Python, etc.
- The two parts of a recursive function are: the first term of sequence and the pattern or the rule followed by the sequence.
- Arithmetic functions are characterized by a common difference between the subsequent terms.
- The recursive formula for an arithmetic function is fn = fn-1 + d.
- Geometric functions are characterized by a common ratio between the subsequent terms.
- The recursive formula for a geometric function is fn = r. fn-1
Sample Questions
Ques. Find the recursive formula for the sequences 3, 6, 9, 12, 15, 18, 21. (3 Marks)
Ans. Given sequence, 3, 6, 9, 12, 15, 18, 21.
- The given sequence is a geometric sequence because if the preceding term is multiplied by 3, we get the successive terms.
- Thus, r = 3
- Hence, the recursive formula is:
- f(1) = 3 , f(n)= 3. f(n-1)
Ques. Find the recursive formula for the sequence 3, 4, 5, 6, 7, 8. (3 Marks)
Ans. Given sequence, 3, 4, 5, 6, 7, 8.
- The given sequence is an arithmetic sequence because if the preceding term is lesser than by 1, we get the successive terms.
- Thus, d = 1
- Hence, the recursive formula is:
- f(1) = 3 , f(n)= 1 + f(n-1)
Ques. Find the recursive formula for the sequence 2, 4, 8, 16, 32. (3 Marks)
Ans. Given sequence, 2, 4, 8, 16, 32.
- The given sequence is a geometric sequence because if the preceding term is multiplied by 2, we get the successive terms.
- Thus, r = 2
- Hence, the recursive formula is:
- f(1) = 2 , f(n)= 3. f(n-1)
Ques. Find the recursive formula for the sequence 3, 7, 11, 15, 19 (3 Marks)
Ans. Given sequence, 3, 7, 11, 15, 19
- The given sequence is an arithmetic sequence because if the preceding term is lesser than by 4, we get the successive terms.
- Thus, d = 4
- Hence, the recursive formula is:
- f(1) = 3 , f(n)= 4 + f(n-1)
Ques. Find the recursive formula for the sequence 6, 12, 24, 48. (3 Marks)
Ans. Given sequence, 6, 12, 24, 48..
- The given sequence is a geometric sequence because if the preceding term is multiplied by 2, we get the successive terms.
- Thus, r = 2
- Hence, the recursive formula is:
- f(1) = 6 , f(n)= 2. f(n-1)
Ques. Find the recursive formula for the sequence 9, 19, 29, 39, 49. (3 Marks)
Ans. Given sequence, 9, 19, 29, 39, 49..
- The given sequence is an arithmetic sequence because if the preceding term is less than by 10, we get the successive terms.
- Thus, d = 10
- Hence, the recursive formula is:
- f(1) = 9 , f(n)= 10 + f(n-1)
Ques. Find the recursive formula for the sequence 4, 16, 64, 96 (3 Marks)
Ans. Given sequence, 4, 16, 64, 96
- The given sequence is a geometric sequence because if the preceding term is multiplied by 4, we get the successive terms.
- Thus, r = 4
- Hence, the recursive formula is:
- f(1) = 4 , f(n)= 4. f(n-1)
Ques. Find the recursive formula for the sequence 2, 4, 6, 8, 10, 12. (3 Marks)
Ans. Given sequence, 2, 4, 6, 8, 10, 12.
- The given sequence is an arithmetic sequence because if the preceding term is less than by 2, we get the successive terms.
- Thus, d = 2
- Hence, the recursive formula is:
- f(1) = 2 , f(n)= 2 + f(n-1)
Ques. Let a1= 4 and an = 2an-1 + 2. Determine the value of a5. (3 Marks)
Ans. Given a1 = 2
- Next determine the value of a2 by putting n = 2 in the equation an = 2an-1 + 2.
- When we put n = 2 then equation will become: a2 = 2a1 + 1 = 2 x 4 + 2 = 10
- So value of a2 is 10.
- Next by using similar method calculate the value of a3 and a4.
- For a3 and a4, put n = 3 and 4
- Then equation for a3= 2a2 + 2 = 2 x 10 + 2 = 22
- Equation for a4 = 2a3 + 1 = 2 x 22 + 2= 46
- Equation for a5 = 2a4 + 1 = 2 x 46 + 2= 94
Ques. Let a1= 5 and an = 10 an-1. Determine the value of a4. (3 Marks)
Ans. Given a1 = 5
- Next determine the value of a2 by putting n = 2 in the equation an = 10 . an-1.
- When we put n = 2 then equation will become: a2 = 10 x a1 = 5 x 10 = 50
- So value of a2 is 50.
- Next by using similar method calculate the value of a3 and a4.
- For a3 and a4, put n = 3 and 4
- Then equation for a3= 10 x a2 = 10 x 50 = 500
- Equation for a4 = 10 x a3 = 10 x 500 = 5000
Ques. Let f(0) = 0 for n greater than equal to 1, f(n) = f(n-1) + 5. Determine the value of f(1), f(2) and f(3). (3 Marks)
Ans. Given f(0) = 0
- Next determine the value f(1) by putting n = 1 in the equation f(n) = f(n-1) + 5.
- When we put n = 1 then equation will become: f(1) = f(0) + 5 = 0 + 5 = 5.
- So value of f(1) is 5.
- For f(2) and f(3), put n = 2 and 3 in the similar equation
- Then equation for f(2) = f(1) + 5 = 5 + 5 = 10.
- Equation for f(3) = f(2) + 5 = 10 + 5 = 15.
Ques. Let a1= 20 and an = 2. an-1. Determine the value of a4. (3 Marks)
Ans. Given a1 = 20
- Next determine the value of a2 by putting n = 2 in the equation an = 2 . an-1.
- When we put n = 2 then equation will become: a2 = 10 x a1 = 2 x 20 = 40
- So value of a2 is 40.
- Next by using similar method calculate the value of a3 and a4.
- For a3 and a4, put n = 3 and 4
- Then equation for a3= 2 x a2 = 2 x 40 = 80
- Equation for a4 = 2 x a3 = 2 x 80 = 160
Ques. Let f(0) = 1 for n greater than equal to 1, f(n) = n!. Determine the value of f(1), f(2) and f(3). (3 Marks)
Ans. Given f(0) = 1
- Next determine the value f(1) by putting n = 1 in the equation f(n) = n!.
- When we put n = 1 then equation will become: f(1) = 1 x 1 = 1.
- So value of f(1) is 1.
- For f(2) and f(3), put n = 2 and 3 in the similar equation
- Then equation for f(2) = 1 x 2 = 2.
- Equation for f(3) = 1 x 2 x 3 = 6.
Ques. Let an = 5n. Determine the value of a4. (3 Marks)
Ans. Given an = 5n
- Next determine the value of a1 by putting n = 1 in the equation an = 5n.
- When we put n = 1 then equation will become: a1 = 51 = 5
- So value of a1 is 5.
- Next by using similar method calculate the value of a2, a3 and a4.
- For a2, a3 and a4, put n = 2, 3 and 4
- Equation for a2 = 52 = 25
- Then equation for a3= 53 = 125
- Equation for a4 = 54 = 625
Ques. Let f(0) = 1 for n greater than equal to 1, f(n) = 6n – 1. Determine the value of f(1), f(2) and f(3). (3 Marks)
Ans. Given f(0) = 1
- Next determine the value f(1) by putting n = 1 in the equation f(n) = 6n -1.
- When we put n = 1 then equation will become: f(1) = 6 x 1 – 1= 5.
- So value of f(1) is 5.
- For f(2) and f(3), put n = 2 and 3 in the similar equation
- Then equation for f(2) = 6 x 2 – 1 = 11
- Equation for f(3) = 6 x 3 – 1 = 17
Ques. Give the recursive definition with initial condition for the function f(n) = 3n + 2, determine the value of n = 1,2,3,4. (3 Marks)
Ans. Given f(n) = 3n + 2
- Next determine the value f(1) by putting n = 1 in the equation f(n) = 3n + 2.
- When we put n = 1 then equation will become: f(1) = 3 x 1 + 2= 5.
- So value of f(1) is 5.
- For f(2) and f(3), put n = 2 and 3 in the similar equation
- Then equation for f(2) = 3 x 2 + 1 = 7
- Equation for f(3) = 3 x 3 + 2 = 11
- Equation for f(4) = 3 x 4 + 2 = 14
Ques. The 13th and 14th terms of the Fibonacci sequence are 14 and 20 respectively. Find the 15th term. (2 Marks)
Ans. Using the recursive formula for the Fibonacci sequence,
15th term is the sum of 13th term and 14th term.
15th term = 13th term + 14th term
= 14 + 20
= 34
Ques. Assume a recursive function on positive integers where f(0) = 2 and function is given as f(n+1) = 2f(n) + 1. Determine the value of n = 1,2,3. (3 Marks)
Ans. Given f(n+1) = 2f(n) + 3
- Next determine the value f(1) by putting n = 0 in the equation f(n+1) = 2f(n) + 3
- When we put n = 1 then equation will become: f(1) = 2 x 2 + 1 = 5.
- So value of f(1) is 5.
- For f(2) and f(3), put n = 1 and 2 in the similar equation
- Then equation for f(2) = 5 x 2 + 1 = 11
- Equation for f(3) = 11 x 3 + 1 = 34
Also Check:






Comments