(a) Ikrimah reports from Ibn Abbas (may Allah be pleased with them both) that the Prophet (peace and blessings be upon him) travelled and, while staying (in one place), shortened the prayer for nineteen days. So when we travelled, we kept shortening the prayer for up to nineteen days, and when we stayed longer, we prayed the complete prayer.
(b) Luwayn narrated it from Abu Awanah, (with the words): "We travelled with the Messenger of Allah (peace and blessings be upon him), and he stayed seventeen days, shortening the prayer." He then also mentioned the statement of Ibn Abbas (may Allah be pleased with them both) about seventeen days.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 5461