A C program to find all factorions using a hash table
You can use the previous sum to compute the next one

Your main loop computes the sum of factorials of digits from scratch for each number, but you are throwing away a lot of work from number to number.  Think about two consecutive numbers, such as:

1234: sum = 1! + 2! + 3! + 4!
1235: sum = 1! + 2! + 3! + 5!


You can see that for 1235, it only differs from 1234 by the last digit, so you can compute its sum more quickly if you do this:

sum = previousSum + 5! - 4!


If the last digit wraps around from 9 to 0, you have to do the same thing with the next digit on the left:

1239: sum = 1! + 2! + 3! + 9!
1240: sum = 1! + 2! + 4! + 0!

sum  = previousSum;
sum += 0! - 9! // Ones digit
sum += 4! - 3! // Tens digit


If you reach a new power of 10, you need to do something a little different:

 99: sum =      9! + 9!
100: sum = 1! + 0! + 0!

sum  = previousSum;
sum += 0! - 9! // Ones digit
sum += 0! - 9! // Tens digit
sum += 1!      // Hundreds digit (note: do not subtract 0!)


Sample rewrite

Using this idea, your function becomes this:

void get_fact_digit_sum(int answers[], int hash_table_fact[])
{
    int answerCount = 0;
    int sum         = 1;

    // Combing through the search space to search for factorions
    for (int i = 1; i &lt;= upper_bound; i++) {
        int temp = i;

        while (1) {
            int digit = temp % base;
            if (digit == 0) {
                sum += hash_table_fact[0] - hash_table_fact[base-1];
                temp /= base;
                if (temp == 1) {
                    // Special case: reached new digit.
                    sum += hash_table_fact[1];
                    break;
                }
            } else {
                sum += hash_table_fact[digit] - hash_table_fact[digit-1];
                break;
            }
        }
        if (sum == i) {
            answers[answerCount++] = i;
        }
    }

    // Placing a 0 at the end to mark the end of the array
    answers[answerCount] = 0;
}


The new way ran 4x faster than the old way for the given upper bound.  If you extend the upper bound to 100 million (even though there are no answers that high), the new way runs 8x faster than the old way.