Skip to main content
added 10 characters in body
Source Link
sergiol
  • 3.5k
  • 1
  • 15
  • 31

Tcl, 8076 80 bytes

proc S l\ u {while \$l<=$u {incr Q $l
incrappend R [expr $l**2]-$l*$l
incr l}
expr $Q**2-$R$Q**2+$R}

Try it online!Try it online!

Tcl, 80 bytes

proc S l\ u {while \$l<=$u {incr Q $l
incr R [expr $l**2]
incr l}
expr $Q**2-$R}

Try it online!

Tcl, 76 80 bytes

proc S l\ u {while \$l<=$u {incr Q $l
append R -$l*$l
incr l}
expr $Q**2+$R}

Try it online!

deleted 53 characters in body
Source Link
sergiol
  • 3.5k
  • 1
  • 15
  • 31

Tcl, 12080 bytes

proc S l\ u {setwhile i\$l<=$u [set{incr jQ $l]$l
while \$i<=$u {incr Q $i
incr i}
while \$j<=$u {incr R [expr $j**2]$l**2]
incr jl}
expr $Q**2-$R}

Try it online!Try it online!

Tcl, 120 bytes

proc S l\ u {set i [set j $l]
while \$i<=$u {incr Q $i
incr i}
while \$j<=$u {incr R [expr $j**2]
incr j}
expr $Q**2-$R}

Try it online!

Tcl, 80 bytes

proc S l\ u {while \$l<=$u {incr Q $l
incr R [expr $l**2]
incr l}
expr $Q**2-$R}

Try it online!

Source Link
sergiol
  • 3.5k
  • 1
  • 15
  • 31

Tcl, 120 bytes

proc S l\ u {set i [set j $l]
while \$i<=$u {incr Q $i
incr i}
while \$j<=$u {incr R [expr $j**2]
incr j}
expr $Q**2-$R}

Try it online!