Use threes to count the threes! Write a program or function that takes two numbers - x&gt;3 and n&gt;0 - as input, and finds all possible bases b where the digit 3 appears at least n times in (x in base b).

Input and output may be through command line or function arguments, stdin/stdout, graphical input/output, error messages, function returns, etc.

The code must consist entirely of three-symbol "words", where each symbol is a letter or number (in printable ASCII) and the words are each separated by one non-alphanumeric printable ASCII character or newline (see example). Furthermore, adding a space into any of the words must ruin the program.

Shortest code wins.

Example

The following code meets the first part of the specs (but doesn't actually work):

abc 123 fwe[3gY]4fs-es3=13N
338 w3W|W2w


Test Cases

5 1 -> 

8 1 -> 5

23 1 -> 4 5 6 7 10 20

15 2 -> 4

111 2 -> 4 6 9 36

819 3 -> 4 16

A test program written in Java 8 can be found at http://pastebin.com/E8GpHbfB.
BBC Basic, 207 bytes

BBC Basic allows you to abbreviate keywords by ending them with a period (e.g., PRINT &Rarr; PRI., REPEAT &Rarr; REP.). I should really be using a named procedure here instead of a function declaration, but abbreviating DEF PROC_whatever to DEF PRO. just isn't going to work.

The rules make it impossible to use an IF statement, so instead I'm calculating the target line of a GOTO statement based on the result of a comparison. (In BBC Basic, true has a value of –1, so 101-ZIP is equal to 102 if ZIP is true, and 101 otherwise.)

The last line (103=000) ends the function definition and returns a value of zero.

Tested on BeebEm3. Lines 10–60 are excluded from the byte count.

10 READ X,N : IF X=0 THEN END
20 PRINT "x=";X;", n=";N
30 A = FNX(X,N)
40 GOTO 10
50 DATA 5,1,8,1,23,1,15,2,111,2,819,3,0,0
60 REM -------------------
100 DEF FNX(FOO,BAR)BAZ=004:REP.BAT=000:QUX=FOO:REP.XXD=QUX MOD BAZ:ZAP=XXD=003:BAT=BAT-ZAP:QUX=QUX-XXD:QUX=QUX/BAZ:UNT.QUX=000:ZIP=BAT&lt;BAR:ZIP=101-ZIP:GOT.ZIP
101 PRI.BAZ
102 BAZ=BAZ+001:UNT.BAZ=FOO
103=000