login
A394987
a(n) is the least product x*y of two integers 2^(n-1) <= x <= y < 2^n maximizing the Hamming weight of this product.
7
1, 6, 30, 126, 510, 2046, 7935, 32767, 196607, 524286, 2031615, 8323071, 50331647, 134217723, 535822335, 2143289343, 8573157375, 66571993087, 103079215103, 549755813887, 2164663517183, 8796093022207, 35184372088831, 140737488355327, 558551906910207, 2250700302057471
OFFSET
1,2
LINKS
FORMULA
a(n) = A394989(n)*A394990(n).
EXAMPLE
n A394988(n)=A000120(a(n)) |
x=A394989(n) | x=A395003(n)
y=A394990(n) | y=A395004(n)
x*y=a(n) | x*y=A394991(n)
|
1 1 1 1 1 | 1 1 1
2 2 2 3 6 | 3 3 9
3 4 5 6 30 | 5 6 30
4 6 9 14 126 | 9 14 126
5 8 17 30 510 | 17 30 510
6 10 33 62 2046 | 33 62 2046
7 12 69 115 7935 | 105 117 12285
8 15 151 217 32767 | 151 217 32767
9 17 421 467 196607 | 421 467 196607
10 18 513 1022 524286 | 933 979 913407
11 20 1341 1515 2031615 | 1705 1845 3145725
12 22 2391 3481 8323071 | 3767 3897 14679999
13 25 6563 7669 50331647 | 7535 7793 58720255
14 26 10209 13147 134217723 | 15727 15985 251396095
15 28 23061 23235 535822335 | 31497 31943 1006108671
16 30 42069 50947 2143289343 | 64265 64711 4158652415
17 32 66225 129455 8573157375 | 128751 129265 16642998015
18 35 257503 258529 66571993087 | 257503 258529 66571993087
19 36 296323 347861 103079215103 | 519647 520673 270566162431
20 39 647089 849583 549755813887 | 647089 849583 549755813887
PROG
(Python)
from sympy.utilities.iterables import multiset_permutations
from sympy import divisors
def A394987(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 m # Chai Wah Wu, Apr 11 2026
KEYWORD
nonn
AUTHOR
Hugo Pfoertner, Apr 09 2026
STATUS
approved