9 votes

Largest Binary Area

JavaScript (V8), 67 bytes Prints the sequence infinitely. for(m=n=0;g=k=>k?!(k&k+1)+g(k>>1):s;print(m=m>s?m:s))s=n&++n?g(n):1 Try it online! ...
  • 179k
7 votes

Largest Binary Area

MATL, 14 13 bytes 1 byte saved thanks to @Suever :B4&1ZIXz5#XM Inputs n and outputs the ...
  • 102k
2 votes

Largest Binary Area

Jelly,  12  11 bytes B«\)LÐṀFS)Ṁ A monadic Link that accepts \$n\$ and yields the largest binary area when arranging the numbers \$1\$ to \$n\$ inclusive. Try it ...
2 votes

Largest Binary Area

Charcoal, 28 bytes FN«≔⁺∧&ι⊕ιθL§⪪⍘⊕ι²0⁰θ⊞υθ⟦I⌈υ Try it online! Link is to verbose version of code. Outputs the first n terms. ...
  • 156k
2 votes

Largest Binary Area

Python3, 333 bytes: ...
  • 5,313
2 votes

Largest Binary Area

Python, 95 93 92 88 bytes m=n=0 while g:=lambda k:k and(k&k+1<1)+g(k>>1):print(m:=max(m,s:=n&(n:=n+1)<1or g(n)+s)) Attempt This Online! Outputs ...
  • 9,146
1 vote

Largest Binary Area

Python 3.8, 85 bytes lambda n:max((j:=2**len(bin(n))>>3)-1,sum(bin(i*2)[2:].find('0')for i in range(j,n))) An anonymous function that accepts a positive ...

Only top scored, non community-wiki answers of a minimum length are eligible