Are you sure that you want "055" as opposed to "55"? Some programs interpret a leading zero as meaning octal, so that it would read 055 as (decimal) 45 instead of (decimal) 55.
That should just mean dropping the '0' (zero-fill) flag.
e.g., change System.out.printf("%03d ", x);
to the simpler System.out.printf("%3d ", x);