A340069
a(n) is the smallest number k not yet used such that the number of 1-bits in the binary representation of k equals the number of 1-bits in the binary representation of k*n.
Original entry on oeis.org
0, 1, 2, 3, 4, 7, 6, 14, 5, 15, 27, 12, 24, 10, 19, 30, 8, 31, 43, 28, 39, 13, 35, 45, 48, 62, 20, 57, 37, 63, 60, 79, 9, 126, 91, 11, 86, 29, 56, 23, 54, 75, 26, 51, 70, 46, 47, 22, 89, 21, 93, 83, 40, 61, 114, 78, 38, 18, 71, 87, 77, 42, 124, 127, 16, 254, 187, 92, 151, 90, 44, 58, 117
Offset: 0
-
function a = A340069( max_n )
a(1) = 1;
n = 2;
t = 1;
while n <= max_n
% search next number t not yet used in a
while ~isempty(find(a==t, 1))
t = t+1;
end
bits1 = length(find(bitget(t,1:32)== 1));
bits2 = length(find(bitget(t*n,1:32)== 1));
if (bits1 == bits2)
% we found a candidate
a(n) = t;
t = 1;
n = n+1;
else
% number t does not yet fit
t = t+1;
end
end
end
-
lista(nn) = {my(va = vector(nn, k, -1)); for (n=0, nn-1, my(k=0); while(! ((hammingweight(k*n) == hammingweight(k)) && !(#select(x->(x==k), va))), k++); va[n+1] = k;); va;} \\ Michel Marcus, Dec 30 2020
-
def binwt(n): return bin(n).count('1')
def aupto(n):
alst, aset = [], set()
for k in range(n+1):
ak = 0
while True:
while ak in aset: ak += 1
if binwt(ak)==binwt(k*ak): break
ak += 1
alst.append(ak)
aset.add(ak)
return alst
print(aupto(72)) # Michael S. Branicky, Jan 02 2021
A340441
Square array, read by ascending antidiagonals, where row n gives all odd solutions k > 1 and n > 0 to A000120(2*n+1) = A000120((2*n+1)*k), A000120 is the Hamming weight.
Original entry on oeis.org
3, 13, 11, 3, 205, 43, 57, 5, 3277, 171, 35, 3641, 7, 52429, 683, 21, 47, 233017, 19, 838861, 2731, 3, 79, 99, 14913081, 23, 13421773, 10923, 241, 5, 197, 187, 954437177, 37, 214748365, 43691, 7, 61681, 7, 325, 419, 61083979321, 39, 3435973837, 174763
Offset: 1
Five initial terms of rows 1-5 are listed below:
1: 3, 11, 43, 171, 683, ...
2: 13, 205, 3277, 52429, 838861, ...
3: 3, 5, 7, 19, 23, ...
4: 57, 3641, 233017, 14913081, 954437177, ...
5: 35, 47, 99, 187, 419, ...
T(3,4) = 19 because: (3*2+1) in binary is 111 and (3*2+1)*19 = 133 in binary is 10000101, both have 3 bits set to 1.
A340349
a(n) is the smallest k such that A292849(k) = 2n-1.
Original entry on oeis.org
1, 3, 13, 5, 57, 35, 21, 9, 241, 219, 49, 45, 169, 83, 73, 17, 993, 59, 941, 53, 3197, 51, 185, 93, 209, 81, 349, 85, 41, 89, 105, 33, 4033, 491, 4749, 247, 449, 227, 429, 363, 3249, 401, 193, 259, 233, 107, 117, 189, 697249, 1355, 173, 517, 473, 1091, 101, 231, 725, 305
Offset: 1
-
function a = A340349(maxA292849)
c = A340351(maxA292849,1);
n = 1; run = 1;
while run == 1
i = find(c==(n*2)-1);
if ~isempty(i);
a(n) = i(1);
n = n+1;
else
run = 0;
end
end
end
function a = A340351(max_n,max_m)
for n = 1:max_n
m = 1; k = 1;
while m < max_m+1
c = length(find(bitget(k,1:32)== 1));
if c == length(find(bitget(n*k,1:32)== 1))
a(n,m) = k;
m = m+1;
end
k = k +1;
end
end
end
-
f(n) = my(k=1); while ((hammingweight(k)) != hammingweight(k*n), k++); k; \\ A292849
a(n) = my(k=1); while(f(k) != 2*n-1, k++); k; \\ Michel Marcus, Jan 09 2021
A340547
Square array, read by ascending antidiagonals, where row n gives all solutions n > 0 to A000120(n+1) = A000120((n+1)*k), A000120 is the Hamming weight.
Original entry on oeis.org
1, 1, 2, 1, 2, 4, 1, 2, 3, 8, 1, 2, 4, 4, 16, 1, 2, 4, 8, 6, 32, 1, 2, 3, 8, 16, 8, 64, 1, 2, 3, 4, 13, 32, 11, 128, 1, 2, 4, 4, 6, 16, 64, 12, 256, 1, 2, 2, 8, 5, 8, 26, 128, 16, 512, 1, 2, 4, 8, 16, 6, 11, 32, 256, 22, 1024
Offset: 1
Eight initial terms of rows 1-8 are listed below:
1: 1, 2, 4, 8, 16, 32, 64, 128, ...
2: 1, 2, 3, 4, 6, 8, 11, 12, ...
3: 1, 2, 4, 8, 16, 32, 64, 128, ...
4: 1, 2, 4, 8, 13, 16, 26, 32, ...
5: 1, 2, 3, 4, 6, 8, 11, 12, ...
6: 1, 2, 3, 4, 5, 6, 7, 8, ...
7: 1, 2, 4, 8, 16, 32, 64, 128, ...
8: 1, 2, 4, 8, 16, 32, 57, 64, ...
T(3,4) = 8 because: (3+1) in binary is 100 and (3*1)*8 = 32 in binary is 100000, both have 1 bit set to 1.
Showing 1-4 of 4 results.
Comments