A twin prime is a prime number that is either 2 less or 2 more than another prime number—for example, either member of the twin prime pair (41, 43). In other words, a twin prime is a primethat has a prime gap of two.
5 and 7 are twin primes because they are consecutive and their difference is 2. On the other hand, 23 and 29 are not twin primes. Even though they are consecutive but their difference is not 2. 2 and 3 are also not twin primes.