you can get the problem statement from here.
first we have to pre-calculate the smallest factor of n array for
1 <= n <= 107
and then using those we can pre-calculate the “amazing prime sequence” for
1 <= n <= 107 in O(n)
note: don’t forget to use int64_t…. i got a wa for using int32_t