Let the sequence
![a(n), n = 1,2,3, \ldots](/media/m/d/3/f/d3fee33f82feafeccdaf3a78bd05ab0a.png)
be generated as follows with
![a(1) = 0,](/media/m/e/e/6/ee600985434d22a5a31505023e41b951.png)
and for
1.) Determine the maximum and minimum value of
![a(n)](/media/m/1/d/7/1d727182bc04bf615d2f9347d052cd83.png)
over
![n \leq 1996](/media/m/0/8/5/0852832bed270ddffa23dbe6f8ddbefe.png)
and find all
![n \leq 1996](/media/m/0/8/5/0852832bed270ddffa23dbe6f8ddbefe.png)
for which these extreme values are attained.
2.) How many terms
![a(n), n \leq 1996,](/media/m/7/6/6/766e7ea72310ee077c73b547f2c05588.png)
are equal to 0?
%V0
Let the sequence $a(n), n = 1,2,3, \ldots$ be generated as follows with $a(1) = 0,$ and for $n > 1:$
$$a(n) = a\left( \left \lfloor \frac{n}{2} \right \rfloor \right) + (-1)^{\frac{n(n+1)}{2}}.$$
1.) Determine the maximum and minimum value of $a(n)$ over $n \leq 1996$ and find all $n \leq 1996$ for which these extreme values are attained.
2.) How many terms $a(n), n \leq 1996,$ are equal to 0?