Shadow the Hedgehog makes his first appearance in episode 33 of Sonic X, and his last in episode 38 of the same series.
Sonic X adapted storylines from the games rather than following one continuous original plot, and Shadow's arc comes from the Shadow the Hedgehog material. That gives him a tight, self-contained stretch of episodes rather than a long-running presence.
He returns in later sagas of the anime, but those appearances belong to different story arcs, which is why episode numbers alone can be misleading when fans compare notes.