CJam, (削除) 26 (削除ここまで) 27 bytes
ri){mp},{2b_1-,mp0円-,mp&},p
Straightforward algorithm, will golf further.
EDIT: Forgot n was inclusive.
Explanation
ri e# Take an int as input
){mp}, e# Take the range up and including to the input,
e# including only prime numbers
{ e# For each prime...
2b_ e# Convert it to binary and copy it
1-,mp e# Take the top binary number, remove 1's, check if the length
e# is prime
\ e# Swap top elements
0-,mp e# Do the same but remove 0's
& e# And
}, e# Filter out primes for which the above block was false
p e# Print nicely
Business Cat
- 9.2k
- 1
- 18
- 37