Convert number to a base where its representation has most "4"s
APL (31 19)

Now tests all possible bases.

⊃⍒{+/4=K⊤⍨K⍴⍵}¨⍳K←⎕


Explanation:


⍳K←⎕: read user input, store in K. Make a list from 1 to K, which are the bases to try.
{...}¨: for each of these, run the following function
K⊤⍨K⍴⍵: encode K into that base giving a list of digits (as numbers) per base. Use K digits (a big overestimate, but it doesn't matter because the unused ones will all be zero anyway).
4=: see which of these are equal to 4
+/: sum these, now we know how many fours per base
⊃⍒: give the indices of the list if it were sorted downwards, so the index of the biggest one is at the front. Take the first item of this list.