Let n be any positive integer and b=3
According to Euclid's division algorithm there exist integers q and r such that
n=3×q+r where 0≤r<3
So value of r can be 0,1 and 2
We can write
n=3×q, n=3×q+1 and n=3×q+2
Now take the each case one by one
Case 1: n=3×q
Take cube on both sides, we have
n3=27×q3 = 9(3×q3)=9m where m=3q3
∴n3+1=9m+1
Similarly for 2nd case n=3×q+1
Taking cube on both sides, we have
n3=27q3+27q2+9q+1 or n3=9(3q3+3q2+q)+1
Which is equal to 9m+1 where m=(3q3+3q2+q)
Thus, n3+1=9m+2
For final case n=3×q+2
Taking cube on both sides, we have
n3=27q3+54q2+36q+8
i.e. n3=9(3q3+6q2+4q)+8
which is equal to 9m+8 where m=(3q3+6q2+4q)
Hence, n3+1=9m+8+1=9m+9=9(m+1)=9n where n=m+1 and n is an integer