Skip to main content
added 1 character in body
Source Link
Kirill L.
  • 14.1k
  • 2
  • 16
  • 50

Ruby, 5857 bytes

->n{s=("*+"*n).chars.reduce(-~n*n/2;n.times2){|i|s=s.digits.inject|x,y|eval ("*+"*n)[i]x.digits*y};s}

Try it online!Try it online!

Ruby, 58 bytes

->n{s=-~n*n/2;n.times{|i|s=s.digits.inject ("*+"*n)[i]};s}

Try it online!

Ruby, 57 bytes

->n{("*+"*n).chars.reduce(-~n*n/2){|x,y|eval x.digits*y}}

Try it online!

Source Link
Kirill L.
  • 14.1k
  • 2
  • 16
  • 50

Ruby, 58 bytes

->n{s=-~n*n/2;n.times{|i|s=s.digits.inject ("*+"*n)[i]};s}

Try it online!