http://www.perlmonks.org?node_id=891656


in reply to Diamonds for fun

Golfed at 83.
perl -E'$n=pop;say$x[@x]=$p=" "x($n-$_).(1x(2*$_-1)+$p*10)for 1..$n;sa +y for@x[map-$_,2..@x]' 9