A Diophantine representation of Wolstenholme's pseudoprimality