Pyth, 14 13
jbf!-jQTU2tSQ
Thanks to Jakube for pointing out the new S
function.
The online version is too slow to do 1234321
. This simply converts the input to each base from 2 to itself and discards the results that contain values other than 0 and 1.
Explanation:
: Q=eval(input) (implicit)jb : join on newlines the list... f! : filter away nonempty values (impliticly named T) -jQTU2 : sewtise difference of number converted to base and range(2) jQT : convert Q to base T U2 : range(2) tSQ : over the range [2 Q+1)
In addition, this is a (not well golfed now well golfed, again thanks to Jakube) bonus version (20 * .75 = 15):
VQI!-JjQK+2NU2pdKjkJ