Utility Function to find next - farther position where gcd is same
function nextPosition ( tempGCD , startPointer , prevEndPointer , n ) { let high = n - 1 ; let low = prevEndPointer ; let mid = prevEndPointer ; let nextPos = prevEndPointer ;