Skip to main content
added 8 characters in body
Source Link
david
  • 609
  • 4
  • 13

Python 3, 6666 65 bytes

lambda a,b:sum(x*y*2for x in range(a,b+1) for y in range(x+1,b+1))

Try it online!Try it online!

with @Dennis formulae and w/o recursion, yet another Python solution (as I cannot comment @leaky-nun solution (not enough reputation)

Python 3, 66 bytes

lambda a,b:sum(x*y*2for x in range(a,b+1) for y in range(x+1,b+1))

Try it online!

with @Dennis formulae and w/o recursion, yet another Python solution (as I cannot comment @leaky-nun solution (not enough reputation)

Python 3, 66 65 bytes

lambda a,b:sum(x*y*2for x in range(a,b+1)for y in range(x+1,b+1))

Try it online!

with @Dennis formulae and w/o recursion, yet another Python solution (as I cannot comment @leaky-nun solution (not enough reputation)

reformat with TIO
Source Link
david
  • 609
  • 4
  • 13

Python 3, 66 bytes

lambda a,b:sum(x*y*2for x in range(a,b+1) for y in range(x+1,b+1))

Python, 67 66 65 bytesTry it online!

lambda a,b:sum(x*y*2for x in range(a,b+1) for y in range(x+1,b+1))

with @Dennis formulae and w/o recursion, yet another Python solution (as I cannot comment @leaky-nun solution (not enough reputation)

Python, 67 66 65 bytes

lambda a,b:sum(x*y*2for x in range(a,b+1) for y in range(x+1,b+1))

with @Dennis formulae and w/o recursion, yet another Python solution (as I cannot comment @leaky-nun solution (not enough reputation)

Python 3, 66 bytes

lambda a,b:sum(x*y*2for x in range(a,b+1) for y in range(x+1,b+1))

Try it online!

with @Dennis formulae and w/o recursion, yet another Python solution (as I cannot comment @leaky-nun solution (not enough reputation)

delete whitespace before car 2 / rearrannge mult. by 2 deleting one more space
Source Link
david
  • 609
  • 4
  • 13

Python, 6767 66 65 bytes

lambda a,b:2*sumsum(x*y forx*y*2for x in range(a,b+1) for y in range(x+1,b+1))

with @Dennis formulae and w/o recursion, yet another Python solution (as I cannot comment @leaky-nun solution (not enough reputation)

Python, 67 bytes

lambda a,b:2*sum(x*y for x in range(a,b+1) for y in range(x+1,b+1))

with @Dennis formulae and w/o recursion, yet another Python solution (as I cannot comment @leaky-nun solution (not enough reputation)

Python, 67 66 65 bytes

lambda a,b:sum(x*y*2for x in range(a,b+1) for y in range(x+1,b+1))

with @Dennis formulae and w/o recursion, yet another Python solution (as I cannot comment @leaky-nun solution (not enough reputation)

delete whitespace before car 2
Source Link
david
  • 609
  • 4
  • 13
Loading
Source Link
david
  • 609
  • 4
  • 13
Loading