It is narrated from Sayyiduna Ubayy bin Ka'b (may Allah be pleased with him) that the Noble Prophet (peace and blessings of Allah be upon him) used to observe i'tikaf during the last ten days of Ramadan. Then one year he could not observe i'tikaf, so the following year he observed i'tikaf for twenty days.