I have this "while" statement and would like to know if is suitable form for a paper. Is there a better way to show this? $$z(n):= \{\ 3^n-1+(--i)-2^ni\ |\ i=0; \text{ while } 2^n (1+i)<3^n+(i++)\ \}$$
Also, are pre-decrement and post-increment good form for a paper?
I have never seen a math (or cs) paper with a while loop inside a set construction. Parsing what you have written will be painful for your readers. Perhaps psuedocode would be acceptable in a cs paper. I suggest writing out the first few examples explicitly, then describing the general case either in words or with $$ z(n) = \{\text{foo}|0 \le i \le \text{bar}\} $$ with an actual expression in terms of $n$ and $i$ for foo. Avoid autoincrement and autodecrement at all costs.
The upper limit can be specified as "where bar is the last value of $i$ for which $\text{foo} \le 2^n$".