Generate Sexy Primes
MATLAB 32
i=1:n;i(isprime(i)&isprime(i+6))
n is your number
J, 34 33 31 32 39 37 characters
s=.[:(,.-&6)[:I.1([:*/p:)"1 i.,.6-~i.
Lost a character keeping both primes below the limit...and another 7 declaring a function.
Usage:
s 100
11 5
13 7
17 11
19 13
23 17
29 23
37 31
43 37
47 41
53 47
59 53
67 61
73 67
79 73
89 83
Edit
Seems like a lot of the new answers are not creating functions, taking input or limiting both numbers in the pair to be below n
- if I ignore those restrictions too I can get down to 28 characters:
(,.6&+)I.*/"1[1 p:(i.,.6+i.)
Mathematica, 35
{#,#+6}&~Array~#~Cases~{__?PrimeQ}&