IIRC there are two versions, one with inbuilt focus motor, one without. The original has an aperture ring and no focus motor, the later version has no aperture ring and a focus motor, and I can confirm it does focus on my D40.
Pretty sure the model of the motor version is the 272E, and some product codes will say "NIK" or "MOTOR" to indicate the presense of the motor.