{"id":19934,"date":"2021-09-02T15:23:41","date_gmt":"2021-09-02T09:53:41","guid":{"rendered":"https:\/\/python-programs.com\/?p=19934"},"modified":"2021-11-22T18:36:29","modified_gmt":"2021-11-22T13:06:29","slug":"python-program-to-find-the-sum-of-series-1-x-x-3-x-n","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-program-to-find-the-sum-of-series-1-x-x-3-x-n\/","title":{"rendered":"Python Program to Find the Sum of Series 1+X+X^3…+X^N"},"content":{"rendered":"

In the previous article, we have discussed Python Program to Find Sum of Series 1\/2-2\/3+3\/4-4\/5+5\/6…+N\/N+1<\/a><\/p>\n

Given the numbers, N and X and the task is to find the sum of the given series (1+X+X^3…+X^N)<\/strong> for the given numbers in Python.<\/p>\n

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

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

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

Given Number = 4\r\nGiven X value =  8<\/pre>\n

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

The total sum of the series till the given number N and x value { 4 8 } =  520<\/pre>\n

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

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

Given Number = 5\r\nGiven X value = 11<\/pre>\n

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

The total sum of the series till the given number N and x value { 5 11 } =  162393<\/pre>\n

Program to Find the Sum of Series 1+X+X^3…+X^N in Python<\/h2>\n

Below are the ways to find the sum of the given series (1+X+X^3…+X^N) <\/strong>for the given numbers in Python :<\/p>\n