Abstract. The orbits of the reversible differential systemẋ = −y,ẏ = x,ż = 0, with x, y ∈ R and z ∈ R d , are periodic with the exception of the equilibrium points (0, 0, z). We compute the maximum number of limit cycles which bifurcate from the periodic orbits of the systemẋ = −y,ẏ = x,ż = 0, using the averaging theory of first order, when this system is perturbed, first inside the class of all polynomial differential systems of degree n, and second inside the class of all discontinuous piecewise polynomial differential systems of degree n with two pieces, one in y > 0 and the other in y < 0. In the first case this maximum number is n d (n − 1)/2, and in the second is n d+1 .