Skip to main content
4 of 5
edited body
Ton Hospel
  • 14.9k
  • 1
  • 22
  • 45

Perl, 78 75 72 bytes

Includes +1 for n

perl -nE '$"=",";say<@{[map"{@{[map$`*($_-.5)/@z,@z=1..$_&-$_]}}",/$/..~-$_]}\\ >' <<< 8

Prints a space separated sequence of comma separated numbers (replace the final space by \n for a more readable output)

Uses a string substitution inside a string substitution.

Ton Hospel
  • 14.9k
  • 1
  • 22
  • 45