cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A357659 a(n) is the least k such that k^2 has a maximal Hamming weight A357658(n) in the range 2^n <= k^2 < 2^(n+1).

This page as a plain text file.
%I A357659 #29 Dec 21 2022 12:53:15
%S A357659 2,3,5,7,11,13,21,27,45,53,75,101,181,217,362,437,627,923,1241,1619,
%T A357659 2505,3915,5221,6475,11309,15595,19637,31595,44491,61029,69451,113447,
%U A357659 185269,244661,357081,453677,642119,980853,1380917,1961706,2965685,3923411,5931189,8096813
%N A357659 a(n) is the least k such that k^2 has a maximal Hamming weight A357658(n) in the range 2^n <= k^2 < 2^(n+1).
%H A357659 Hugo Pfoertner, <a href="/A357659/b357659.txt">Table of n, a(n) for n = 2..125</a>, including results from Bert Dobbelaere and from users l4m2, gsitcia, and anttiP in Code Golf challenge (terms 103..125)
%H A357659 Code Golf Stackexchange, <a href="https://codegolf.stackexchange.com/questions/255529/smallest-and-largest-100-bit-square-with-maximum-hamming-weight">Smallest and largest 100-bit square with maximum Hamming weight</a>, fastest code challenge started Dec 15 2022.
%e A357659 See A357658.
%o A357659 (Python 3.10+)
%o A357659 from math import isqrt
%o A357659 def A357659(n):
%o A357659     c = 0
%o A357659     for k in range(isqrt((1<<n)-1)+1,isqrt((1<<n+1)-1)+1):
%o A357659         if (d:=(k**2).bit_count()) > c:
%o A357659             c, m = d, k
%o A357659         elif d == c:
%o A357659             m = min(m,k)
%o A357659     return m # _Chai Wah Wu_, Oct 14 2022
%o A357659 (C, x64asm, Rust, c++) see Code Golf link.
%Y A357659 Cf. A000120, A000290, A357658, A357660.
%K A357659 nonn,base
%O A357659 2,1
%A A357659 _Hugo Pfoertner_, Oct 09 2022