Original entry on oeis.org
0, 1, 2, 4, 7, 12, 19, 30, 40, 56, 74, 89, 114, 130, 157, 180, 210, 253, 276, 318, 352, 388, 421, 457, 498, 557, 593, 644, 688, 734, 780, 823, 871, 919, 975, 1032, 1080, 1165, 1238, 1300, 1362, 1426, 1490, 1554, 1622, 1686, 1759, 1878, 1945, 2013, 2106, 2186, 2268, 2350, 2432, 2500, 2593, 2679, 2757, 2853, 2939, 3029
Offset: 0
A303765
Permutation of nonnegative integers: a(n) = A048675(A303761(n)); see comments for an equivalent alternative description.
Original entry on oeis.org
0, 1, 3, 2, 7, 4, 5, 15, 8, 9, 11, 10, 31, 16, 17, 19, 18, 23, 6, 63, 32, 33, 35, 34, 39, 36, 37, 47, 12, 13, 127, 64, 65, 67, 66, 71, 68, 69, 79, 14, 255, 128, 129, 131, 130, 135, 132, 133, 143, 136, 137, 139, 138, 159, 20, 21, 511, 256, 257, 259, 258, 263, 260, 261, 271, 264, 265, 267, 266, 287, 24, 25, 27, 26, 1023, 512, 513, 515, 514, 519, 516, 517, 527
Offset: 0
For a(2), a(1) = 1, and the only subset mask (a number k for which bitor(k,1) = k) is 1 itself, already present, so we start toggling 0's to 1's with binary expansion "...00001" of 1, and we get "11" (= binary representation of 3), and 3 is not yet present, thus a(2) = 3.
For a(3), previous a(2) = 3, "...011" in binary, and "10" (= 2) is the least and only submask that is not already present, thus a(3) = 2.
For a(4), previous = 2, "...010" in binary, and there are no submasks that are not already used, thus we start toggling 0's to 1's from the right, and "11" (3) is already present, but "111" (7) is not, thus a(4) = 7.
For a(5), previous = 7, with seven submasks "1", "10", "11", "100", "101", "110", "111" (binary representations for 1 - 7), and of these "100", "101", "110" (4, 5 and 6) are not yet present. A019565(4) = 5, A019565(5) = 10 and A019565(6) = 15, so we choose the first one, thus a(5) = 4.
For a(6), previous = 4, "..0100" in binary, and no submasks that wouldn't have been already used, thus by toggling from the right, we first obtain "...0101" = 5, which is still free, so a(6) = 5.
For a(7), previous = 5, "..0101" in binary, and no submasks that would be free (both 1 and 4 are already present), thus by toggling from the right, we first obtain "...0111" = 7, which also has been used, so we continue filling the zeros, to next obtain "...1111" = 15, which is still free, so a(7) = 15.
For a(8), previous = 15, "..1111" in binary, and the submasks not used are "110" = 6, "1000" = 8, "1001" = 9, "1010" = 10, "1011" = 11, "1100" = 12, "1101" = 13 and "1110" = 14. Applying A019565 to these numbers, A019565(8) = 7 gives the smallest value, thus a(8) = 8.
Cf.
A300829 (positions of records).
-
up_to = (2^7)-1;
A006519(n) = (2^valuation(n, 2));
A019565(n) = {my(j,v); factorback(Mat(vector(if(n, #n=vecextract(binary(n), "-1..1")), j, [prime(j), n[j]])~))}; \\ From A019565
A048675(n) = { my(f = factor(n)); sum(k=1, #f~, f[k, 2]*2^primepi(f[k, 1]))/2; };
v303765 = vector(up_to);
m303766 = Map();
w=1; for(n=1,up_to,s = Set([]); for(m=1,w, if((bitor(w,m)==w) && !mapisdefined(m303766,m), s = setunion(Set([A019565(m)]),s))); if(length(s)>0, w = A048675(vecmin(s)), while(mapisdefined(m303766,w), w += A006519(1+w))); v303765[n] = w; mapput(m303766,w,n));
A303765(n) = if(!n,n,v303765[n]);
A303766(n) = if(!n,n,mapget(m303766,n));
Original entry on oeis.org
0, 1, 3, 2, 5, 6, 4, 7, 9, 10, 12, 11, 14, 15, 13, 8, 17, 18, 20, 19, 22, 23, 21, 24, 26, 27, 29, 28, 31, 16, 30, 25, 33, 34, 36, 35, 38, 39, 37, 40, 42, 43, 45, 44, 47, 48, 46, 41, 50, 51, 53, 52, 55, 56, 54, 57, 59, 60, 62, 61, 32, 49, 63, 58, 65, 66, 68, 67, 70, 71, 69, 72, 74, 75, 77, 76, 79, 80, 78, 73, 82, 83, 85, 84, 87
Offset: 0
Original entry on oeis.org
0, 1, 3, 2, 5, 6, 8, 4, 10, 11, 13, 12, 15, 16, 18, 7, 20, 21, 23, 22, 25, 26, 28, 24, 30, 31, 33, 32, 35, 36, 38, 9, 40, 41, 43, 42, 45, 46, 48, 44, 50, 51, 53, 52, 55, 56, 58, 47, 60, 61, 63, 62, 65, 66, 68, 64, 70, 71, 73, 72, 75, 76, 78, 14, 80, 81, 83, 82, 85, 86, 88, 84, 90, 91, 93, 92, 95, 96, 98, 87, 100, 101, 103, 102, 105
Offset: 0
Showing 1-4 of 4 results.
Comments