[Solved] How to find the number of contiguous subsequences / subarrays whose product can be expressed as difference of squares of 2 random integers?
Any number can be represented as a difference of squares if it is odd, or a multiple of 4. The problem arises when a product has only a single 2 in the prime factorisation. So we can mark them. (i.e all the 2) Given this we can easily deduce that only what is not a … Read more