Hello,
It would be great if I can get some nudge in the right direction for the following question :
There is a sequence that contains in ascending order natural numbers that are products of at least two natural consecutive number, example :
2,6,12,20,24,30,42,56,60,72,..
Find the nth natural number in the sequence
n = 1 , result = 2 ( 1 * 2)
n = 2 , result = 6 ( 2 * 3)
n = 4, result = 20 ( 4 * 5)
n = 9, result = 60 ( 3 * 4* 5)
1 <= n <= 10^6
result must be smaller than or equal to 10^12.








Since we know that the $$$ \text{result} \leq 10^{12} $$$, for a product of $$$2$$$ consecutive numbers the max value of the larger of the $$$2$$$ numbers = $$$10^6$$$. Also, we know the length of the longest product of consecutive numbers = $$$14$$$ because $$$ 15! \gt 10^{12} $$$. Could we possibly brute force this?
It is not necessary to get a product of only 2 consecutive numbers. It can be more as well. It says at least 2 consecutive numbers. In this case, I wasn't able to come up with a brute force which gave the ascending order as well
Yeah, and like I've said above the longest possible product of consecutive numbers = $$$14$$$. Since we know that there are $$$10^6$$$ ways to have a product of $$$2$$$ consecutive numbers and clearly less ways to have a product of $$$3, \dots ,14$$$ consecutive numbers, we can bound the total number of values to check by $$$10^6 \cdot (14-1) \approx 10^7$$$. We can just go through all values in a double for loop and add them to a set. The nth number in this set is the result.
The sequence is 2,6,12,20,24,30,42,56,60,72 n=3 is 12. So I think multiple ways to reach a nth term all count as one term