Function that returns the maximum length subsequence such that adjacent elements have a common factor .
static int maxLengthSubsequence ( int [ ] arr , int n ) { int [ ] dp = new int [ N ] ; Hashtable pos = new Hashtable ( ) ;