An algorithm to compute the Hilbert depth

We give an algorithm which computes the Hilbert depth of a graded module based on a theorem of Uliczka. Partially answering a question of Herzog, we see that the Hilbert depth of a direct sum of modules can be strictly greater than the Hilbert depth of all the summands.