isDisarium = function(n) num = n sum = 0 if num == 0 then return true for i in range(ceil(log(n)), 1) sum += (n % 10) ^ i n = floor(n / 10) end for return num == sum end function foundCnt = 0 cnt = 0 while foundCnt < 19 if isDisarium(cnt) then foundCnt += 1 print cnt end if cnt +=1 end while