How to get a base-3 representation of an integer using a stack?
ok I think I found the solution to my question 

So if n = 141, 12020 would be printed to the screen.

Solution:

          public static void printBase3(int n){
           if (n/3 == 0)
           System.out.print(n);
          else{
          printBase3(n/3);
          System.out.print(n%3);
          }
        }