274 B
274 B
Thats one big sieve, even though not as big as the on in problem 10.
Here we needed a way to "rotate" a number: value = value%10 * 10^digitcount + value/10
. The rest is standard befunge stuff and trying to optimize it.