public class SierpinskiTriangle {

    public static void main(String[] args) {
        System.out.println(getSierpinskiTriangle(4));
    }

    private static final String getSierpinskiTriangle(int n) {
        if ( n == 0 ) {
            return "*";
        }

        String s = getSierpinskiTriangle(n-1);
        String [] split = s.split("\n");
        int length = split.length;