Let us take a as any positive integer and b=7
according to Euclid's Division Lemma,
we get a=7q+r , where r is remainder, value of q is more than or equal to 0 and r=0,1,2,3,4,5,6 because 0≤r<b and the value of b=7
So possible forms will be 7q,7q+1,7q+2,7q+3,7q+4,7q+5,7q+6
Now, to get cube of these values use the formula
(a+b)3=a3+3a2b+3ab2+b3
In this formula value of a is always 7q
so, we get
(7q+b)3=343q3+147q2b+21qb2+b3
Now divide by 7 , we get quotient = 49q3+21q2r+3qr2 and remainder is b3
⟹(7q+b)3=7(49q3+21q2r+3qr2)+b3=7m+b3, where m=49q3+21q2r+3qr2
so we have to consider the value of b3
b=0 we get 7m+0=7m
b=1 then 13=1 so we get 7m+1
b=2 then 23=8 divided by 7 we get 1 as remainder so we get 7m+1
b=3 then 33=27 divided by 7 we get 6 as remainder so we get 7m+6
b=4 then 43=64 divided by 7 we get 1 as remainder so we get 7m+1
b=5 then 53=125 divided by 7 we get 6 as remainder so we get 7m+6
b=6 then 63=216 divided by 7 we get 6 as remainder so we get 7m+6
so all values are in the form of 7m,7m+1 and 7m+6