A triangular number is a number that is the sum of the integers from 1 to some integer n. Thus 1 is a triangular number because it is the sum of the integers from 1 to 1; 6 is a triangular number because 1+2+3=6. Given the non-negative integers m and n (with m < n), create a list of the triangular numbers between (and including) m and n. Thus if m is 3 and n is 20, the list would be: [3, 6, 10, 15]. Assign the list to the variable triangulars.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 21PE
icon
Related questions
Question

Code in Python

A triangular number is a number that is the sum of the integers from 1 to some integer n. Thus 1 is a
triangular number because it is the sum of the integers from 1 to 1; 6 is a triangular number because
1+2+3=6.
Given the non-negative integers m and n (with m < n), create a list of the triangular numbers between
(and including) m and n. Thus if m is 3 and n is 20, the list would be: [3, 6, 10, 15]. Assign the list to
the variable triangulars.
Transcribed Image Text:A triangular number is a number that is the sum of the integers from 1 to some integer n. Thus 1 is a triangular number because it is the sum of the integers from 1 to 1; 6 is a triangular number because 1+2+3=6. Given the non-negative integers m and n (with m < n), create a list of the triangular numbers between (and including) m and n. Thus if m is 3 and n is 20, the list would be: [3, 6, 10, 15]. Assign the list to the variable triangulars.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Troubleshooting
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning