Procedure Kaprekar(n.i) nn.q = n*n tens.q= 1 While tens