I have this function:
$$f(n) = \frac{(-1)^n + 1}{2}$$
For $n \in Z$ It seems be equal to $1$ if $n$ is an even number and $0$ otherwise:
$$ \begin{array}{c|c} n & -3 & -2 & -1 & 0 & 1 & 2 & 3 \\ \hline f(n) & 0 & 1 & 0 & 1 & 0 & 1 & 0 \end{array} $$
It seems to me that it is the same as:
$$1-(n \mod 2)$$
Is there some other representation of this function which does not use $(-1)^n$? I would like to stay as close as possible to basic algebraic operations like addition, subtraction, multiplication, division or exponentiation and to avoid modulo, floor, ceiling and similar.
I don't know of an easier form of your function, its already in simplest terms. What about this function?
$\displaystyle\frac{1}{2}(\frac{(-n)^n}{n^n}+1)$
It has the exact properties you mention, addition, subtraction, division, multiplication and exponentiation.
There is also an integral,
$\displaystyle\frac{n}{2}\int_{-1}^{1}x^{n-1} dx=\frac{1-(-1)^{n}}{2}.$
How about
$gcd(n,2)-1$
And, although you don't want floor function,
$\displaystyle\lfloor\frac{n}{2}\rfloor-\lfloor\frac{n-1}{2}\rfloor=\frac{1+(-1)^n}{2}.$
If none of these work, what's wrong with simply 1 if even and 0 if odd?
As a side note, $(-1)^{n}$ literally means just multiply $-1$ by itself n times.