 
Summary: A Generalization of Magic Squares with Applications to Digital
Halftoning
Boris Aronov1 , Tetsuo Asano2 , Yosuke Kikuchi3, Subhas C. Nandy4,
Shinji Sasahara5, and Takeaki Uno6
1 Polytechnic University, Brooklyn, NY 112013840, USA, http://cis.poly.edu/~aronov
2 JAIST, Nomi, 9231292 Japan, tasano@jaist.ac.jp
3 ERATO QCI Project, JST, Tokyo 1130033, Japan, kikuchi@qci.jst.go.jp
4 Indian Statistical Institute, Kolkata 700 108, India, nandysc@isical.ac.in
5 Fuji Xerox Co., Ltd., Kanagawa 2590157, Japan. shinji.sasahara@fujixerox.co.jp
6 National Institute of Informatics (NII), Tokyo, 1018430 Japan, uno@nii.jp
Abstract. A semimagic square of order n is an n ¢n matrix containing the integers 0 n2 1 arranged in
such a way that each row and column add up to the same value. We generalize this notion to that of a zero k ¢k
discrepancy matrix by replacing the requirement that the sum of each row and each column be the same by that
of requiring that the sum of the entries in each k¢k square contiguous submatrix be the same. We show that such
matrices exist if k and n are both even, and do not if k and n are are relatively prime. Further, the existence is also
guaranteed whenever n km, for some integers k m 2. We present a spaceefficient algorithm for constructing
such a matrix.
Another class that we call constantgap matrices arises in this construction. We give a characterization of such
matrices.
An application to digital halftoning is also mentioned.
