I noticed that the triangle numbers given by $\frac{n(n+1)}{2}$ have a parity pattern of odd, odd, even, even, ... and I'm curious as to why.
E.g:
n T(n) P(T(n))
1 1 1
2 3 1
3 6 0
4 10 0
5 15 1
6 21 1
7 28 0
8 36 0
9 45 1
10 55 1
11 66 0
12 78 0
13 91 1
14 105 1
I can see that the parities for $n^2+n$ are all 0, as in:
n F(n) P(F(n))
1 2 0
2 6 0
3 12 0
4 20 0
5 30 0
6 42 0
7 56 0
but I'm having trouble seeing why halving these values leads to the odd, odd, even, even,... pattern for the triangle numbers.
Can anyone shed some light please?
If $n\equiv 1 \mod 4$ or $n\equiv 2 \mod 4$, then out of $n$ and $(n+1),$ one of them is odd, and the other is divisible by $2$ but not $4,$ and so $n(n+1)/2$ is not divisible by $2.$
If $n\equiv 3 \mod 4$ or $n\equiv 4 \mod 4$, then out of $n$ and $(n+1),$ one of them is odd, and the other is divisible by $4,$ and so $n(n+1)/2$ is even.