n = 8 k = 1 while k <= n: j = n/2 while j >= 1: print j j = j/2 k = k+1 print "j = " + str(j) print "n = " + str(n) print "k = " + str(k)