W d, 5 bytes
(Possibly the only <=5-byter that does not use a prime or number factorization built-in?) (The two spaces here represent a tab)
‡T B⑸àTéBΦ repr'd:'‡T\tB⑸'
Unpacked:
m!Wk2= Explanation
This is really difficult to read, so an explanation will be nice.
W % (implicit) Foreach the inclusive range from 1 to the input: bam % The "bam" magic! Just kidding. Evaluates b % a % Since b is out-of-bounds, this takes the upper-level input % as the operand. ! % Remove those that aren't valid multiples. k % Is the length of the array ... 2= % ... equal to 2? % i.e. primes have exactly 2 factors: 1 and itself