IBNHIBBAN 3662: from Anas —
[Machine] "The Messenger of Allah ﷺ used to observe I'tikaf during the last ten nights of Ramadan when he was residing in Mecca. But when he traveled, he would observe I'tikaf for twenty nights in the following year."

ابن حبّان ٣٦٦٢: عن انس —
«كَانَ رَسُولُ اللَّهِ ﷺ إِذَا كَانَ مُقِيمًا يَعْتَكِفُ فِي الْعَشْرِ الْأَوَاخِرِ مِنْ رَمَضَانَ فَإِذَا سَافَرَ اعْتَكَفَ مِنَ الْعَامِ الْمُقْبِلِ عِشْرِينَ»


Sound (Arnaʾūṭ)
Ibn Ḥibbān > Book of Fasting > § [Machine] Al-Itikaf and Laylat al-Qadr
hadithunlocked.com