That strikes me as much harder, but I would be curious if there is an easy way to do it.
It seems like the constraint that a1*a2*... = 500 provides a way to choose the values for ai. But how do we choose the primes to find those combinations that will result in a triangular number? Or barring that, is there a way we can test if the result is triangular?
For example, a factor that is the fourth power of a prime gives you five divisors (16 has divisors 1, 2, 4, 8 and 16). To have exactly 500 = 5 * 5 * 5 * 2 * 2 divisors, you could have for example prime factors a^4 * b^4 * c^4 * d * e, or a^4 * b^4 * c^4 * d^3, or a^9 * b^4 * c^4 * d, and so on.
As posted before, to calculate the number of divisors of n * (n+1) / 2, you divide the even of n and n+1 by 2, calculate the divisors of each, and multiply. One of them must have a number of divisors that is a multiple of 25, which means it is a multiple of p^4 * q^4, p^9 * q^4, p^9 * q^9, p^19 * q^4, p^24, p^49, p^99, p^124, p^249, or p^499.
We can easily find all numbers of these forms up to 2^63. Let's say x = p^4 * q^4. x is either the odd number out of n and n+1, or half of the even number out of n and n+1. So we can always have (n = 2x, n+1 = 2x+1), or (n = 2x-1, n+1 = 2x). If x is odd then it can be the odd one of n, n+1 so we can have (n = x, n+1 = x+1) or (n = x-1, n+1 = x).
So the number of divisors of x can be multiplied with the number of divisors of 2x+1, 2x-1, and for odd x the number of divisors of (x+1)/2 or (x-1)/2.
So the algorithm: Produce all numbers x where the number of divisors is a multiple of 25, and at the same time divides 500. Then examine the numbers 2x+1, 2x-1, and (x+1)/2 and (x-1)/2 if x is odd, calculate the number of divisors, and check if the product is 500.
Unless x has 125, 250, or 500 factors, the other number must be a factor that is a power of 4, which will be quite rare.
We can restrict the search to values x < 2^63 so the other number is < 2^64 and can be examined easily. That gets rid of the cases p^99, p^124, p^249 and p^499 already. p*q must be less than about 50,000 even for the case of p^4 * q^4, and p^q can be multiplied by a prime, the cube of a prime, or two primes.