QUESTION 1By tracing successive value of r find the output from the following algorithm whena) n =13 b) n =20beginInput n;R:=n;While r>5 doR; = r -5;Output r; endWhat can be said about n when the output from the algorithm is zero?Question 3-Prove by
QUESTION 1By tracing successive value of r find the output from the following algorithm whena) n =13 b) n =20beginInput n;R:=n;While r>5 doR; = r -5;Output r; endWhat can be said about n when the output from the algorithm is zero?Question 3-Prove by induction on n that(12) + (23) + (34) + .. + n (n+1) = 1/3 n (n+1)(n+2)For all integers n>1Question4Consider the following subsets of the set Z of all integers. For each of the following propositions state whether it is true or false. In each case brief reason for your answer. Question 5-A relation R on Z is given by x + 3y is an even integer.a) Show that if integers x and y are R-related then either x and y are both even or x and y are both odd.b) With the help of part (a) prove that R is an equivalence relation.