Function to find the longest subsequence which contain all prime numbers
static int longestPrimeSubsequence ( int [ ] arr , int n ) { bool [ ] prime = new bool [ N + 1 ] ; for ( int i = 0 ; i < N + 1 ; i ++ ) prime [ i ] = true ;