Number of isosceles triangle. Prove that the number of isosceles triangles with integer sides, no side exceeding n, is $ \frac{1}{4}(1+3n^2)$ or $\frac{3}{4}(n^2)$ according to whether n is odd or even.
I am able to count the number of isosceles triangles which have the length of equal sides greater than or equal to length of base. I cannot count the remaining triangles.

If the base is $2i-1$ for some $i\geq 1$ (i.e. odd), then there are $n-i + 1$ isosceles (non-degenerate) triangles. If the base is $2j$ (i.e. even) for some $j \geq 1$, there are $n-j$ isosceles triangles. Also note that there are $\lceil n/2\rceil$ odd numbers and $\lfloor n/2\rfloor$ even numbers that are $\leq n$ (and positive). That means that we sum up
$$
\overbrace{\sum_{i = 1}^{\lceil n/2\rceil}(n-i + 1)}^{\text{Odd bases}} + \overbrace{\sum_{j = 1}^{\lfloor n/2\rfloor} (n - j)}^{\text{Even bases}}
$$
It should be quite easy from here to divide up into $n$ even or odd and do the direct calculations from there using the sum of arithmetic series.
