a question about powerful numbers

I found this code in a website that is meant to echo all powerful numbers between 4 and 1000. I'm not being able to fully understand it! Here is the code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
int com = 1000, x, m, k, z;
    for (int l = 4; l < com; l++) {
        x = l;
        m = 3;
        k = 0;
        z = x;
        while (x % 2 == 0) {
            x /= 2;
            k += 1;
        }

        while ((m <= x) && (k != 1)) {
            k = 0;
            while (x % m == 0) {
                x /= m;
                k += 1;
            }
            m += 2;
        }

        if (k > 1)
            cout << z << ' ';
    }

Did you google search the term "powerful numbers"? I've never heard of the concept myself.
http://en.wikipedia.org/wiki/Powerful_number
I did and the program works 100%; I'm just trying to understand how this program works, I tried to trace it for more than 2 hours and didn't get a hold of it.
I read the whole article on Wiki but I still don't get the idea behind this code.
Topic archived. No new replies allowed.