Mishkat al-Masabih 4595
Hafsa reported God’s messenger as saying:
“If anyone resorts to a diviner ( arraf ) and asks him about anything prayer will not be accepted from him for forty days.”*

Muslim transmitted it.

* Literally, Nights.
وعن حفصة قالت : قال رسول الله صلى الله عليه وسلم : 
" من أتى عرافا فسأله عن شيء لم تقبل صلاة أربعين ليلة " . رواه مسلم