Skip to content
geeksforgeeks
  • Tutorials
    • Python
    • Java
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
    • Practice Coding Problems
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Number System and Arithmetic
  • Algebra
  • Set Theory
  • Probability
  • Statistics
  • Geometry
  • Calculus
  • Logarithms
  • Mensuration
  • Matrices
  • Trigonometry
  • Mathematics
Open In App
Next Article:
Recursive Formula
Next article icon

Recursive Formula

Last Updated : 16 Apr, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

A recursive function is a function that defines each term of a sequence using the previous term i.e., The next term is dependent on one or more known previous terms. Recursive function h(x) is written as,

h(x) = a0h(0) + a1h(1) + a2h(2) + ... + ax - 1h(x - 1)

where,

  • ai ≥ 0
  • i = 0, 1, 2, 3, ... ,(x - 1)

The recursion formulas are the formulas that are used to write the recursive functions or recursive series.

Recursive Formula

Recursive Formula is a formula that defines each term of sequence using the previous/preceding terms. It defines the following parameters

  • First Term of Sequence
  • Pattern rule to get any term from its previous terms

Recursive Formulas For Various Sequences

Recursive Sequences are the sequences in which the next term of the sequence is dependent on the previous term. One of the most important recursive sequence is the Fibonacci Sequence:

The recursive formulas or the recursion formulas for different kinds of the sequences are,

Sequence TypeRecursive FormulaDescription
Arithmetic Sequencean = a(n-1) + d for n ≥ 2Each term is obtained by adding a constant d to the previous term.
Geometric Sequencean = an-1 ·r for n ≥ 2Each term is obtained by multiplying the previous term by a constant ratio r.
Fibonacci SequenceFn = Fn−1 + Fn−2 for n ≥ 2Each term is the sum of the two preceding terms, starting with F0 = 0 and F1 = 1.
Triangular NumbersTn = Tn−1 + nThe nth triangular number is the sum of the first n natural numbers.
Factorialn! = n⋅(n−1)!The factorial of n is the product of all positive integers up to n, with 0! = 1.

Read More,

  • Harmonic Progression
  • Geometric Series
  • Arithmetic Series

Examples Using Recursive Formula

Example 1: Given a series of numbers with a missing number in middle 1, 11, 21, ?, 41. Using recursive formula find the missing term.

Solution:

Given: 1, 11, 21, ..., 41

First term (a) = 1

d = T2 - T1 = T3 - T2
⇒ d = 11 - 1 = 21 - 11 = 10

Recursive Function in AP an = an-1 + d

a4 = a4-1 + d
⇒ a4 = a3 + d
⇒ a4 = 21 + 10
⇒ a4 = 31

Example 2: Given series of numbers 5, 9, 13, 17, 21,... From the given series find the recursive formula 

Solution:

Given number series: 5, 9, 13, 17, 21,...

First Term (a) = 5

d = T2 - T1 = T3 - T2
⇒ d = 9 - 5 = 13 - 9 = 4

Recursive Formula for AP an = an-1 + d

an = an-1 + 4

Example 3: Given a series of numbers with a missing number in middle 1, 3, 9,...,81, 243. Using recursive formula find the missing term.

Solution:

Given: 1, 3, 9,..., 81, 243

First Term (a) = 1

  • a2/a1 = 3/1 = 3
  • a3/a2 = 9/3 = 3
  • a5/a4 = 243/81 = 3

Common Ratio (r) = 3

Recursive Function to find nth term in GP an = an-1 × r

a4 = a4-1 × r
⇒ a4 = a3 × r
⇒ a4 = 9 × 3
⇒ a4 = 27

Example 4: Given series of numbers 2, 4, 8, 16, 32, ... From the given series find the recursive formula.

Solution:

Given number series,

2, 4, 8, 16, 32, ...

First term (a) = 2

  • a2/a1 = 4/2 = 2
  • a3/a2 = 8/4 = 2
  • a4/a3 = 16/8 = 2

Common Ratio (r) = 2

Recursive Formula an = an-1 × r

an = an-1 × 2

Example 5: Find the 5th term in a Fibonacci series if the 3rd and 4th terms are 2,3 respectively.

Solution:

Given,

  • a3 = 2
  • a4 = 4

Then in Fibonacci Sequence, a5 = a3 + a4

a5 = 2 + 3
⇒ a5 = 5


Next Article
Recursive Formula

A

akhilvasabhaktula03
Improve
Article Tags :
  • Mathematics
  • School Learning
  • Maths-Formulas

Similar Reads

    Rectangle Formula
    Rectangle belongs to the family of parallelograms, and parallelograms come under the types of quadrilaterals. The quality of a rectangle is that it has all its internal angles at 90°. The opposite sides of the rectangle are equal, however, the adjacent sides are not necessarily equal.Table of Conten
    6 min read
    Reduction Formula
    Reduction formula in mathematics is generally used for solving integration of higher order. Integration involving higher-order terms is difficult to handle and solve. So, to simplify the solving process of higher-order terms and get rid of the lengthy expression-solving process of higher-order degre
    4 min read
    Square Root Formula
    Square root formula is a mathematical expression that calculates the square root of a number. For a non-negative real number xx, the square root y is a number such that y2 = x. A square root is an operation that is used in many formulas and different fields of mathematics. This article is about squa
    8 min read
    Interest Rate Formula
    An interest rate is the percentage of the principal amount (the initial sum of money) that a borrower must pay to a lender in exchange for borrowing money or the return earned by an investor on their investments. It represents the cost of borrowing or the profit from lending money over a specified p
    8 min read
    Recursion in Perl
    Recursion is a mechanism when a function calls itself again and again till the required condition is met. When the function call statement is written inside the same function then such a function is referred to as a recursive function.The argument passed to a function is retrieved from the default a
    3 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences