{"id":9229,"date":"2021-10-01T11:00:55","date_gmt":"2021-10-01T05:30:55","guid":{"rendered":"https:\/\/python-programs.com\/?p=9229"},"modified":"2021-11-22T18:33:26","modified_gmt":"2021-11-22T13:03:26","slug":"python-program-to-find-the-sum-of-the-series-1-1-2-1-3-1-n","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-program-to-find-the-sum-of-the-series-1-1-2-1-3-1-n\/","title":{"rendered":"Python Program to Find the Sum of the Series: 1 + 1\/2 + 1\/3 + \u2026.. + 1\/N"},"content":{"rendered":"

Given a number , the task is to find the sum of series 1 + 1 \/ 2 + …… + 1 \/number<\/strong> in Python.<\/p>\n

The inverse of a series is considered to be in Harmonic Progression if it follows the rule of an A.P, i.e. Arithmetic Progression. In general, the terms in a harmonic progression can be written as 1\/a, 1\/(a + d), 1\/(a + 2d), 1\/(a + 3d),…. 1\/(a + nd).
\nAs the Nth term of AP is (a + (n \u2013 1)d).
\nAs a result, the Nth term of harmonic progression is the reciprocal of the Nth term of AP, which is: 1\/(a + (n \u2013 1)d), where “a” is the first term of AP and “d” is the common difference.<\/p>\n

Examples:<\/strong><\/p>\n

Example1:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

total number of terms = 17<\/pre>\n

Output:<\/strong><\/p>\n

The total sum of the series  3.44<\/pre>\n

Example2:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

Enter the total numbers of terms =26<\/pre>\n

Output:<\/strong><\/p>\n

The total sum of the series 3.85<\/pre>\n

Program to Find the Sum of the Series: 1 + 1\/2 + 1\/3 + \u2026.. + 1\/N in Python<\/h2>\n

There are several ways to find the sum of the given series some of them are:<\/p>\n