Skip to main content
deleted 7 characters in body
Source Link
alephalpha
  • 50k
  • 7
  • 68
  • 182

Pari/GPPari/GP, 3331 bytes

Saved one byte thanks to Mr. Xcoder.

a->b->sum(i=a,b,hammingweightsumdigits(i,2))

Try it online!Try it online!

Pari/GP, 33 bytes

Saved one byte thanks to Mr. Xcoder.

a->b->sum(i=a,b,hammingweight(i))

Try it online!

Pari/GP, 31 bytes

Saved one byte thanks to Mr. Xcoder.

a->b->sum(i=a,b,sumdigits(i,2))

Try it online!

added 115 characters in body
Source Link
alephalpha
  • 50k
  • 7
  • 68
  • 182

Pari/GPPari/GP, 3433 bytes

Saved one byte thanks to Mr. Xcoder.

(a,b)->b->sum(i=a,b,hammingweight(i))

Try it online!Try it online!

Pari/GP, 34 bytes

(a,b)->sum(i=a,b,hammingweight(i))

Try it online!

Pari/GP, 33 bytes

Saved one byte thanks to Mr. Xcoder.

a->b->sum(i=a,b,hammingweight(i))

Try it online!

Source Link
alephalpha
  • 50k
  • 7
  • 68
  • 182

Pari/GP, 34 bytes

(a,b)->sum(i=a,b,hammingweight(i))

Try it online!