Ghost in the Machine

The crew ends up being trapped in a never-ending Holodeck program where they are tasked with solving a mystery that may have no solution.