How many square numbers are there among the numbers 1 to 1000?

How many triangular numbers are there among the numbers 1 to 1000?

2 answers

perfect squares are of the form n^2
so you want n^2 < 1000
n < √1000 < appr 31.6...

31^2 = 961
32^2 =1024
So there are 31 perfect squares less than 1000

Triangular numbers are 1,3,6,10,15,...
(think of racking up billiard balls in its triangle and adding the balls.
The first row has 1 ball, after 2 rows you have 3 balls, after 3 rows you have 6 balls, etc. That is why they are called triangular numbers.)

These numbers are produced by n(n+1)/2
we want:
n(n+1)/2 < 1000
n^2 + n < 2000
n^2 + n - 2000 < 0
If we had n^2 + n - 2000 = 0
n = appr 44.2.. or n is a negative

if n = 44, 44(45)/2 = 990 , if n = 45, we go greater than 1000

So there are 44 triangular numbers less than 1000
n^2 <= 1000
n <= √1000 = 31.6

The nth triangular number is n(n+1)/2
So, you need

n(n+1)/2 <= 1000
n <= 44.2