write triangular formulas to find numbers between 10 and 30

If you think about triangular numbers then:

xn = n ( n + 1 ) / 2

n = 1

x1 = 1 * ( 1 + 1 ) / 2 =

1 * 2 / 2 = 2 / 2 = 1

1 is less than 10.

n = 2

x2 = 2 * ( 2 + 1 ) / 2 =

2 * 3 / 2 = 6 / 2 = 3

3 is less than 10.

n = 3

x3 = 3 * ( 3 + 1 ) / 2 =

3 * 4 / 2 = 12 / 2 = 6

6 is less than 10.

n = 4

x4 = 4 * ( 4 + 1 ) / 2 =

4 * 5 / 2 = 20 / 2 = 10

n = 5

x5 = 5 * ( 5 + 1 ) / 2 =

5 * 6 / 2 = 30 / 2 = 15

n = 6

x6 = 6 * ( 6 + 1 ) / 2 =

6 * 7 / 2 = 42 / 2 = 21

n = 7

x7 = 7 * ( 7 + 1 ) / 2 =

7 * 8 / 2 = 56 / 2 = 28

n = 8

x8 = 8 * ( 9 + 1 ) / 2 =

8 * 9 / 2 = 72 / 2 = 36

36 is greater then 30.

So a triangular numbers between 10 and 30:

10 , 15 , 21 , 28