The Prophet ﷺ used to observe i'tikaf during the last ten days of Ramadan. One year he did not observe i'tikaf. When the next year came, he observed i'tikaf for twenty nights (i.e. days). (Using translation from Abū Dāʾūd 2463)
أَنَّ رَسُولَ اللهِ ﷺ كَانَ «يَعْتَكِفُ الْعَشْرَ الْأَوَاخِرَ مِنْ رَمَضَانَ فَسَافَرَ عَامًا فَلَمْ يَعْتَكِفْ فَلَمَّا كَانَ الْعَامُ الْمُقْبِلُ اعْتَكَفَ عِشْرِينَ»