Sierpinksi triangle problem solution in Scala