We consider the problem of tiling a segment {0, . . . , n} of the discrete line. More precisely, we ought to characterize the structure of the patterns that tile a segment and their number. A pattern is a subset of N. A tiling pattern or tile for {0, . . . , n} is a subset A P(N) such that there exists B P(N) and such that the direct sum of A and B equals {0, . . . , n}. This problem is related to the difficult question of the decomposition in direct sums of the torus Z/nZ (proposed by Minkowski). Using combinatorial and algebraic techniques, we give a new elementary proof of Krasner factorizations. We combinatorially prove that the tiles are direct sums of some arithmetic sequences of specific lengths. Besides, we show there are as many tiles whose smallest tilable segment is {0, . . . , n} as tiles whose smallest tilable segment is {0, . . . , d}, for all strict divisors d of n. This enables us to exhibit an optimal linear time algorithm to compute for a given pattern the smallest ...