Let a be an arbitrary positive integer. Then, by Euclid's division algorithm, corresponding to the positive integers a and 6, there exist non - negative integers q and r such that;
a= 6q+r, where,0≤r<6
⇒ a3=(61+r)3=216q3+r3+3.6qr(6q+r)
[∴ (a+b)3=a3+b3+3ab(a+b)]
⇒ a3=(216q3+108q2r+18qr2+r3) ...(i)
Where, 0≤r<6.
Case I
When r = 0, putting r = 0 in eq (i), we get,
a3=216q3=6(36q3)=6m
Where, m= 36q3 is an integer.
Case II
When r = 2, putting r = 2 in eq. (i), we get,
a3= (216q3+216q2+72)+8
a3= (216q3+216q2+72q+6)+2
⇒ a3=6(36q3+36q2+12q+1)+2=6m+2
Where m= (36q3+36q2+12q+1) is an integer.
Class III
When r = 3, putting r = 3 in eq. (i), we get,
a3=(216q3+432q2+288q)+64
= 6(36q3+72q2+48q)+60+4
= 6(36q3+72q2+48q+10)+4=6m+4
Where, m= (36q3+72q2+48q+10) is an integer.
Hence, the cube of a positive integer of the form 6q + r, where q is an integer and r = 0 1, 2, 3, 4, 5 is also of the forms 6m , 6m + 1 6m + 2, 6m + 3, 6m + 4 and 6m + 5 i.e., 6m + r.