The negabinary representation of a number n is its representation in base -2 (i.e., base negative 2). It is therefore given by the coefficients a_n a_(n - 1) ...a_1 a_0 in n | = | sum_(i = 0) a_i (-2)^i | = | ... + a_2 (-2)^2 + a_1 (-2)^1 + a_0 (-2)^0, where a_i = 0, 1.