Question: A number n is considered to be triangular if we can find a sum of numbers in the range from I to m that
A number n is considered to be triangular if we can find a sum of numbers in the range from I to m that is equal to this n. m is a number that is strictly smaller than n. For example, 10 is triangular because there is a sum resulting in 10: 1+2+3+4 = 10 and 4 < 10, whereas 5 is not triangular because no sum that starts with 1 to a number smaller than 5 can give 5 (1+2= 3 less than 5 and 1+2+3= 6 greater than 5). Write a program that prompts the user to enter a positive number n and displays whether this n is a triangular number or not. Sample Run 1: Enter a positive number: 10 10 is a triangular number.
Step by Step Solution
3.34 Rating (157 Votes )
There are 3 Steps involved in it
Heres a Python program that checks if a given number is triangular or not p... View full answer
Get step-by-step solutions from verified subject matter experts
