{"id":20074,"date":"2021-09-06T13:36:34","date_gmt":"2021-09-06T08:06:34","guid":{"rendered":"https:\/\/python-programs.com\/?p=20074"},"modified":"2021-11-22T18:36:28","modified_gmt":"2021-11-22T13:06:28","slug":"python-program-to-print-triangular-number-series-1-3-6-10-15-n","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-program-to-print-triangular-number-series-1-3-6-10-15-n\/","title":{"rendered":"Python Program to Print Triangular Number series 1 3 6 10 15 …N"},"content":{"rendered":"

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

Given a number N and the task is to find the triangular number series (1 3 6 10 15 …N)<\/strong> until the given number.<\/p>\n

int() function in Python:<\/strong><\/p>\n

The int() function is used to transform a value into an integer number.<\/p>\n

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

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

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

Given Number = 8<\/pre>\n

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

The Triangular series until the given number{ 8 } is :\r\n1 3 6 10 15 21 28 36<\/pre>\n

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

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

Given Number = 15<\/pre>\n

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

The Triangular series until the given number{ 15 } is :\r\n1 3 6 10 15 21 28 36 45 55 66 78 91 105 120<\/pre>\n

Program to Print Triangular Number series 1 3 6 10 15 …N in Python<\/h2>\n

Below are the ways to find the triangular number series (1 3 6 10 15 …N)<\/strong> until the given number N :<\/p>\n