VOOZH about

URL: https://www.geeksforgeeks.org/dsa/harmonic-progression/

⇱ Harmonic Progression Program - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Harmonic Progression Program

Last Updated : 11 Jul, 2025

A sequence of numbers is called a Harmonic progression if the reciprocal of the terms are in AP. In simple terms, a, b, c, d, e, f are in HP if 1/a, 1/b, 1/c, 1/d, 1/e, 1/f are in AP. For example, 1/a, 1/(a+d), 1/(a+2d), and so on are in HP because a, a + d, a + 2d are in AP. 

👁 Image


Fact about Harmonic Progression : 

  1. In order to solve a problem on Harmonic Progression, one should make the corresponding AP series and then solve the problem.
  2. As the nth term of an A.P is given by an = a + (n-1)d, So the nth term of an H.P is given by 1/ [a + (n -1) d].
  3. For two numbers, if A, G and H are respectively the arithmetic, geometric and harmonic means, then 
    • A ≥ G ≥ H
    • A H = G2, i.e., A, G, H are in GP
  4. If we need to find three numbers in a H.P. then they should be assumed as 1/a–d, 1/a, 1/a+d
  5. Majority of the questions of H.P. are solved by first converting them into A.P


Formula of Harmonic Progression: 

👁 Image


How we check whether a series is harmonic progression or not?
The idea is to reciprocal the given array or series. After reciprocal, check if differences between consecutive elements are same or not. If all differences are same, Arithmetic Progression is possible. So as we know if the reciprocal of the terms are in AP then given a sequence of series is in H.P. Let's take a series 1/5, 1/10, 1/15, 1/20, 1/25 and check whether it is a harmonic progression or not. Below is the implementation: 

Output:

Yes


Time Complexity: O(n Log n). 

Auxiliary Space: O(n)
Basic Program related to Harmonic Progression 


Recent Articles on Harmonic Progression!

Comment
Article Tags:
Article Tags: