8
1
Sexy Primes are pairs of numbers (n, m) such as n and m both are prime, and m = n + 6.
You need to create a function which will take an integer, check for sexy primes from 0 to that integer, and return an array of arrays.
For example, listSexy(30) must return [[5,11], [7,13], [11,17], [13,19], [17,23], [23,29]] or some equivalent.
This is code-golf so the program with the shortest bytecount wins!
Can you explain what the desired output format looks like? – Howard – 13 years ago
11Bah, I hate it when the challenge changes after answers have been submitted. – Griffin – 13 years ago
2Is there a certain reason to check from 0? Why shouldn't I check from (5,11)? A short definition of sexy primes should be given right here, while linking to Wikipedia for further reading is welcome. – user unknown – 13 years ago
1In Portuguese Sexy Primes translates to the same as Sexy Cousins! – sergiol – 8 years ago