Explanation of notation required?

What is the meaning of the notation

$sign(k \mod 4)$

where $k$ is a positive integer? The notation can be found, for example in the paper "Minimum triangle-free graphs".

-
$k \mod 4$ is the remainder of $k$ divided by $4$. The $sign$ function is 1 for positive arguments, -1 for negative arguments, and 0 if the argument is 0. So, $sign(k\mod 4)$ will be 0 if $k$ is divisible by 4 and 1 otherwise. –  David Mitra Nov 25 '11 at 11:11
This reminds me of Iverson's bracket convention –  uli Nov 25 '11 at 11:19
@DavidMitra: please post that as an answer? –  Willie Wong Nov 25 '11 at 12:13

$k\bmod 4$ is the remainder obtained when $k$ is divided by $4$ (for example, $14\bmod 3$ is $2$).

The sign function ($sign$, as you have it) is $1$ for positive arguments, $-1$ for negative arguments, and $0$ if the argument is $0$. That is: $${\rm sign}\,(x)=\cases{\hphantom{-}1,& x>0\cr \hphantom{-}0,&x=0\cr -1,& x<0 }\ \ .$$

So, ${\rm sign}\,(k\bmod4)$ will be $0$ if $k$ is divisible by $4$ and $1$ otherwise.

-
Note that depending on the computing environment, $\mathrm{sign}(0)$ can either be $1$ or $0$. SIGN(1,0) in FORTRAN returns 1, for instance. –  Ｊ. Ｍ. Nov 25 '11 at 13:19
Hi, Thanks for the answer. If the convention was that sign$(0) = 1$ then we'd have sign$(k \mod 4) = 1$ for all $k$, so I'm sure it's meant to be 0. –  Cye Nov 25 '11 at 15:02
@Cye Beware that this answer implicitly assumes that the $\rm\:mod\:$ function employs nonnegative residue class representatives - which is not always true - see my answer. –  Bill Dubuque Jan 11 '12 at 16:53

As is often the case, one can easily deduce the meaning from its use. On p. 88 we find

Reading the proof we infer that for $\rm\ x\ =\ k\ mod\ 4\$

$\rm\qquad\qquad\qquad x\ =\ 0\ \ \Rightarrow\ \ sign(x)\ =\ 0$

$\rm\qquad\qquad\qquad x\ \ne\ 0\ \ \Rightarrow\ \ sign(x)\ =\ 1$

So the author requires that, $\rm\ mod\ 4,\:$ the $\rm\:sign\:$ map fixes $0$ and maps all nonzero residues to $\rm\:1\:.\:$

Note that if the $\rm\:mod\ 4\:$ map uses a balanced residue system $\rm\:\{-1, 0, 1, 2\}\$ then the $\rm\:sign\:$ map is not that given in David's answer, since it has $\rm\:sign(-1) = -1\:,\:$ but the author requires $\rm\:sign(-1) = 1\:.$

-