This question already has an answer here:
- Find the Nth pair of twin primes 22 answers
We define twin primes as two natural numbers
p,p+2 which both are prime.
7 are twin primes.
Let's define the twin number of some set of numbers as the number of twin prime numbers in that set
31} has a twin number
4, since there are four twin primes;
Input: A number
Output: The twin number of the set of all natural numbers below
This is code-golf, so lowest bytes wins.