Function to find the longest subsequence which contain all prime numbers
static int longestPrimeSubsequence ( int arr [ ] , int n ) { boolean [ ] prime = new boolean [ N + 1 ] ; Arrays . fill ( prime , true ) ;