login
A394988
a(n) is the maximum Hamming weight of the product x*y of two integers 2^(n-1) <= x <= y < 2^n.
4
1, 2, 4, 6, 8, 10, 12, 15, 17, 18, 20, 22, 25, 26, 28, 30, 32, 35, 36, 39, 40, 43, 45, 47, 48, 50, 52, 55, 56, 58, 60, 63, 65, 66, 68, 70, 72, 75, 76, 78, 81, 82, 85, 87, 88, 90, 93, 95, 96, 99, 100, 102, 105, 106, 108, 111, 113, 115, 117, 119, 120, 122, 125
OFFSET
1,2
LINKS
EXAMPLE
See A384987 and A394991.
PROG
(Python)
from sympy.utilities.iterables import multiset_permutations
from sympy import divisors
def A394988(n):
a = 1<<n-1
b = a<<1
k = (n<<1)-1
for l in range(k, 0, -1):
for s in multiset_permutations('0'*(k+1-l)+'1'*l):
m = int(''.join(s), 2)
for d in divisors(m):
if d**2>m:
break
if a<=d<b and a*d<=m<b*d:
return l # Chai Wah Wu, Apr 09 2026
CROSSREFS
KEYWORD
nonn
AUTHOR
Hugo Pfoertner, Apr 09 2026
EXTENSIONS
a(24)-a(63) from Chai Wah Wu, Apr 09 2026
STATUS
approved