The nilpotent part and distinguished form of resonant vector fields or diffeomorphisms