Algorithm to determine if a number is perfect on a Turing Machine
You need do do:


Factor the number given
Add up the factors, and check they add up to $n$


It should be something like:

sum = 0;
for(k = 1; k &lt; n; k++) {
     if(n % k == 0)
         sum += k;
}
return sum == n;


To get n % k == 0 you can:

tmp = n;
while(tmp &gt; 0)
    tmp -= k;
return tmp == 0;


Translating into TM-speak and splicing all this together isn't hard, just very tedious. Use a multitape TM to simplify your description.