#include"totient.bas" dim as uinteger found = 0, curr = 3, sum, toti while found < 20 sum = totient(curr) toti = sum do toti = totient(toti) sum += toti loop while toti <> 1 if sum = curr then print sum found += 1 end if curr += 1 wend