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, 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
A303751
Suspected divisor-or-multiple permutation: a(1) = 1, and for n > 1, a(n) is either the least divisor of a(n-1) not already present, or (if all divisors already used), a(n) = a(n-1) * {the least power of the least prime not dividing a(n-1) such that the term is not already present}.
Original entry on oeis.org
1, 2, 6, 3, 12, 4, 36, 9, 18, 90, 5, 10, 30, 15, 60, 20, 180, 45, 360, 8, 24, 120, 40, 1080, 27, 54, 270, 135, 540, 108, 2700, 25, 50, 150, 75, 300, 100, 900, 225, 450, 3150, 7, 14, 42, 21, 84, 28, 252, 63, 126, 630, 35, 70, 210, 105, 420, 140, 1260, 315, 2520, 56, 168, 840, 280, 7560, 72, 1800, 200, 600, 4200
Offset: 1
a(64) = 280 = 2^3 * 5 * 7 = prime(1)^3 * prime(3) * prime(4), which by Heinz-encoding corresponds to integer partition {1+1+1+3+4}. We try to remove all 1's (to get {3+4}, i.e., prime(3)*prime(4) = 35, but that has already been used as a(52)), or to remove either 3 or 4 or both, but also 8, 40 and 56 have already been used, and if we remove all 1's and either 3 or 4, then also prime(3) and prime(4), 5 and 7 have already been used. So we must add one or more copies of 2 (the least missing part) to find a partition that has not already been used. And it turns out we need to add three copies, to get {1+1+1+2+2+2+3+4} to obtain value prime(1)^3 * prime(2)^3 * prime(3) * prime(4) = 7560 not used before, so a(65) = 7560.
For the next partition, we remove two 2's and both 3 and 4, to get {1+1+1+2+2} which gives Heinz-code 2^3 * 3^2 = 72, which is the smallest divisor of 7560 that has not been used before in the sequence, thus a(66) = 72.
Cf.
A113552,
A282291,
A304531,
A304755 for similarly defined sequences, and also
A064736,
A207901,
A281978,
A302350,
A302781,
A302783,
A303771 for other permutations satisfying the divisor-or-multiple property.
Cf.
A304728,
A304729 (see their scatter plots for alternative views to this process).
Differs from a variant
A304531 for the first time at n = 66, where a(66) = 72, while
A304531(66) = 189.
-
up_to = 2^14;
A053669(n) = forprime(p=2, , if (n % p, return(p))); \\ From A053669
v303751 = vector(up_to);
m303752 = Map();
prev=1; for(n=1,up_to,fordiv(prev,d,if(!mapisdefined(m303752,d),v303751[n] = d;mapput(m303752,d,n);break)); if(!v303751[n], p = A053669(prev); while(mapisdefined(m303752,prev), prev *= p); v303751[n] = prev; mapput(m303752,prev,n)); prev = v303751[n]);
A303751(n) = v303751[n];
A303752(n) = mapget(m303752,n);
A303760
Divisor-or-multiple permutation of squarefree numbers: a(0) = 1, and for n >= 1, a(n) is either the least divisor of a(n-1) not already present in the sequence, or (if all divisors already used), a(n-1) * {the least prime p such that p does not divide a(n-1) and p*a(n-1) is not already present}.
Original entry on oeis.org
1, 2, 6, 3, 15, 5, 10, 30, 210, 7, 14, 42, 21, 105, 35, 70, 770, 11, 22, 66, 33, 165, 55, 110, 330, 2310, 77, 154, 462, 231, 1155, 385, 5005, 13, 26, 78, 39, 195, 65, 130, 390, 2730, 91, 182, 546, 273, 1365, 455, 910, 10010, 143, 286, 858, 429, 2145, 715, 1430, 4290, 30030, 1001, 2002, 6006, 3003, 15015, 255255, 17, 34, 102, 51, 255, 85, 170, 510, 3570, 119
Offset: 0
From _Michael De Vlieger_, May 23 2018: (Start)
Table below shows the initial 32 terms at right. First column is index n, second shows "." if a(n) = largest divisor of a(n-1), or factor p. Third shows presence "1" or absence "." of prime k among prime divisors of a(n).
n p\d MN(n) a(n)
--------------------------------
0 . . 1
1 2 1 2
2 3 11 6
3 . .1 3
4 5 .11 15
5 . ..1 5
6 2 1.1 10
7 3 111 30
8 7 1111 210
9 . ...1 7
10 2 1..1 14
11 3 11.1 42
12 . .1.1 21
13 5 .111 105
14 . ..11 35
15 2 1.11 70
16 11 1.111 770
17 . ....1 11
18 2 1...1 22
19 3 11..1 66
20 . .1..1 33
21 5 .11.1 165
22 . ..1.1 55
23 2 1.1.1 110
24 3 111.1 330
25 7 11111 2310
26 . ...11 77
27 2 1..11 154
28 3 11.11 462
29 . .1.11 231
30 5 .1111 1155
31 . ..111 385
... (End)
-
Nest[Append[#, Block[{d = Divisors@ #[[-1]], p = 2}, If[Complement[d, #] != {}, Complement[d, #][[1]], While[Nand[Mod[#[[-1]], p] != 0, FreeQ[#, p #[[-1]] ] ], p = NextPrime@ p]; p #[[-1]] ] ] ] &, {1}, 71] (* Michael De Vlieger, May 23 2018 *)
-
up_to = 2^7;
A053669(n) = forprime(p=2, , if (n % p, return(p))); \\ From A053669
v303760 = vector(up_to);
m_inverses = Map();
prev=1; for(n=1,up_to,fordiv(prev,d,if(!mapisdefined(m_inverses,d),v303760[n] = d;mapput(m_inverses,d,n);break)); if(!v303760[n], apu = prev; while(mapisdefined(m_inverses,try = prev*A053669(apu)), apu *= A053669(apu)); v303760[n] = try; mapput(m_inverses,try,n)); prev = v303760[n]);
A303760(n) = v303760[n+1];
A303762
a(0) = 1, and for n >= 1, a(n) is either the largest divisor of a(n-1) not already present in the sequence, or (if all divisors already used), a(n-1) * {the least prime p such that p does not divide a(n-1) and p*a(n-1) is not already present}.
Original entry on oeis.org
1, 2, 6, 3, 15, 5, 10, 30, 210, 105, 35, 7, 14, 42, 21, 231, 77, 11, 22, 66, 33, 165, 55, 110, 330, 2310, 1155, 385, 770, 154, 462, 6006, 3003, 1001, 143, 13, 26, 78, 39, 195, 65, 130, 390, 2730, 1365, 455, 91, 182, 546, 273, 4641, 1547, 221, 17, 34, 102, 51, 255, 85, 170, 510, 3570, 1785, 595, 119, 238, 714, 357, 3927, 1309, 187, 374, 1122, 561, 2805, 935
Offset: 0
From _Michael De Vlieger_, May 23 2018: (Start)
Table below shows the initial 31 terms at right. First column is index n. Second shows "." if a(n) = largest divisor of a(n-1), or factor p. Third shows presence "1" or absence "." of prime k among prime divisors of a(n).
n p\d MN(n) a(n)
---------------------------
0 . . 1
1 2 1 2
2 3 11 6
3 . .1 3
4 5 .11 15
5 . ..1 5
6 2 1.1 10
7 3 111 30
8 7 1111 210
9 . .111 105
10 . ..11 35
11 . ...1 7
12 2 1..1 14
13 3 11.1 42
14 . .1.1 21
15 11 .1.11 231
16 . ...11 77
17 . ....1 11
18 2 1...1 22
19 3 11..1 66
20 . .1..1 33
21 5 .11.1 165
22 . ..1.1 55
23 2 1.1.1 110
24 3 111.1 330
25 7 11111 2310
26 . .1111 1155
27 . ..111 385
28 2 1.111 770
29 . 1..11 154
30 3 11.11 462
31 13 11.111 6006
... (End)
-
Nest[Append[#, Block[{d = Divisors@ #[[-1]], p = 2}, If[Complement[d, #] != {}, Complement[d, #][[-1]], While[Nand[Mod[#[[-1]], p] != 0, FreeQ[#, p #[[-1]] ] ], p = NextPrime@ p]; p #[[-1]] ] ] ] &, {1}, 75] (* Michael De Vlieger, May 22 2018 *)
-
default(parisizemax,2^31);
up_to = 2^14;
A053669(n) = forprime(p=2, , if (n % p, return(p))); \\ From A053669
v303762 = vector(up_to);
m_inverses = Map();
prev=1; for(n=1,up_to,fordiv(prev,d,if(!mapisdefined(m_inverses,(prev/d)),v303762[n] = (prev/d);mapput(m_inverses,(prev/d),n);break)); if(!v303762[n], apu = prev; while(mapisdefined(m_inverses,try = prev*A053669(apu)), apu *= A053669(apu)); v303762[n] = try; mapput(m_inverses,try,n)); prev = v303762[n]);
A303762(n) = v303762[n+1];
Original entry on oeis.org
0, 1, 3, 2, 5, 6, 18, 4, 8, 9, 11, 10, 28, 29, 39, 7, 13, 14, 16, 15, 54, 55, 88, 17, 70, 71, 73, 72, 128, 129, 420, 12, 20, 21, 23, 22, 25, 26, 156, 24, 110, 111, 113, 112, 178, 179, 209, 27, 151, 152, 154, 153, 274, 275, 822, 155, 384, 385, 387, 386, 1943, 1944, 4580, 19, 31, 32, 34, 33, 36, 37, 252, 35, 242, 243, 245, 244, 316, 317, 497, 38, 247
Offset: 0
Showing 1-6 of 6 results.
Comments