Traverse through map and print non repeating primes
for ( Map . Entry < Integer , Integer > entry : mp . entrySet ( ) ) { if ( entry . getValue ( ) == 1 ) System . out . println ( entry . getKey ( ) ) ; } }