cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-6 of 6 results.

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

Views

Author

Antti Karttunen, May 02 2018

Keywords

Comments

a(0) = 0 and for n > 0, if there are one or more k_i that are not already present in the sequence among terms a(0) .. a(n-1), and for which bitor(k_i,a(n-1)) = a(n-1), then a(n) = that k_i which gives minimum value of A019565(k_i) amongst them; otherwise, when no such k_i exists, a(n) = the least number not already present that can be obtained by cumulatively filling the successive vacant bits of a(n-1) from the least significant end of its binary representation (by toggling 0's to 1's, possibly also one or more leading zeros).
Shares with permutations like A003188, A006068, A300838, A302846, A303763, and A303767 the property that when moving from any a(n) to a(n+1) either a subset of 0-bits are toggled on (changed to 1's), or a subset of 1-bits are toggled off (changed to 0's), but no both kind of changes may occur at the same step.
A300829 gives the positions of records (terms of A000225 in ascending order), that for cases n=2..79 are followed by 2^(n-1).

Examples

			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.
		

Crossrefs

Cf. A303766 (inverse).
Cf. A303763, A303767 (variants).
Cf. A300829 (positions of records).

Programs

  • PARI
    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));

Formula

a(n) = A048675(A303761(n)).
For all n >= 0, A019565(a(n)) = A303761(n).

A300829 Positions of records in A303761 and in A303765; a(n) = A303766(A000225(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

Views

Author

Antti Karttunen, May 03 2018

Keywords

Crossrefs

Programs

Formula

a(n) = A303766(A000225(n)) = A303766((2^n)-1).
For n >= 0, A303761(a(n)) = A002110(n).
For n = 2 .. 79, A303761(1+a(n)) = A000040(n).

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

Views

Author

Antti Karttunen, May 01 2018

Keywords

Comments

The greedy algorithm which constructs this sequence can be understood also in terms of Heinz encodings of partitions (see A215366): Any term a(n) corresponds to a particular integer partition {s1+...+sk} via mapping a(n) = prime(s1) * ... * prime(sk), where s1 .. sk are the summands of an integer partition. The choices for constructing the next partition are: If by removing any parts from the partition we can find any smaller partitions that have not already occurred in the sequence, then we choose the one which has the smallest Heinz encoding value. On the other hand, if all partitions obtained by such removals have already occurred in the sequence, then we add to the current partition the least number of copies of the least positive integer that is not yet a part of the partition (A257993), until a partition is found which is not yet in the sequence.
From Antti Karttunen & David A. Corneth, May 01 - 04 2018: (Start)
No two successive descending terms, that is, a(n) > a(n+1) > a(n+2) never occurs.
For n > 1, if a(n) is odd then a(n-1) = 2^h * k * a(n) and a(n+1) = 2^j * a(n) for some h, k and j, that is, odd terms occur between two larger even numbers.
If a(n) < a(n+1) < a(n+2) then (a(n+1) / a(n)) is a divisor of a(n+2).
However, when a(n) < a(n+1) > a(n+2) then (a(n+1) / a(n)) might not be a divisor of a(n+2). The first such case occurs at n=64..66, as a(64) = 280 = 2^3 * 5 * 7, a(65) = 7560 = 2^3 * 3^3 * 5 * 7, and a(66) = 72 = 2^3 * 3^2. We have 7560/280 = 27, which is not a divisor of 72 (72/27 = 8/3).
In most cases, when a(n+1) < a(n) then gcd(a(n+1), a(n)/a(n+1)) = 1 (about 87% for the first 100000 descents). However, there are many exceptions to this, the first case occurring at a(65) = 7560 = 2^3 * 3^3 * 5 * 7 and a(66) = 72 = 2^3 * 3^2, with gcd(72,7560/72) = 3.
(End)
From David A. Corneth, May 04 2018: (Start)
The sequence can be partitioned into a tabf sequence with rows having the first element odd and the others even. It would give (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), ...
It turns out that some rows are multiples of others; for example, the row (5, 10, 30) is five times the row (1, 2, 6). (End)
See also "observed scaling patterns" in the Formula section.
A303750 gives the positions of odd terms.
A282291 and A304531 are unitary divisor variants that satisfy the condition gcd(a(n+1), a(n)/a(n+1)) = 1, whenever a(n) > a(n+1).
The primes 2, 3, 5, 7, 11, 13, 19, 23 and 29 occur at positions 2, 4, 11, 42, 176, 1343, 8470, 57949, 302739, 1632898, thus after 7 and except for 13, a little earlier than they occur in variant A304531.

Examples

			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.
		

Crossrefs

Cf. A303752 (inverse).
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. also A303761.
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.

Programs

  • PARI
    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);

Formula

Observed scaling patterns:
For n = 2 .. 2 + 0, a(n) = 2*a(n-1).
For n = 4 .. 4 + 0, a(n) = 3*a(n-3).
For n = 11 .. 11 + 7, a(n) = 5*a(n-10).
For n = 42 .. 42 + 23, a(n) = 7*a(n-41).
For n = 176 .. 176 + 80, a(n) = 11*a(n-175).
For n = 1343 .. 1343 + 683, a(n) = 13*a(n-1342).
For n = 8470 .. 8470 + 3610, a(n) = 17*a(n-8469).
For n = 57949 .. 57949 + 18554, a(n) = 19*a(n-57948).

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

Views

Author

Antti Karttunen, May 02 2018

Keywords

Comments

Each a(n+1) is either a divisor or a multiple of a(n).
If a(n+1) > a(n), then A001222(a(n+1)) = 1 + A001222(a(n)).
From Antti Karttunen, May 23 2018: (Start)
For n >= 1, A006530(a(n)) = A000040(A070939(n)), thus the greatest prime dividing n, or equally, its index (A061395), is monotonic and follows the length of binary representation of n. This follows by induction on the size of the binary representation of n, and the fact that the "least possible unused divisor" part of a greedy rule can find all the unused divisors of A002110(k) before the next larger prime A000040(1+k) is needed as a factor.
For n >= 1, a((2^k)+1) = A000040(k+1), that is, after the first term with the next larger prime factor, which always occurs at 2^k, the next term is that prime itself, which is prime(k+1).
(A) For r in range 1 .. (2^(k-1)), a((2^k)+r) = A000040(k+1) * a(r-1), and prime A000040(k) is not present in the factorization. Because we cannot divide prime(k+1) out, as that would give a term already encountered, and because every term in this range has it as a largest prime factor, the relative magnitude-wise order of the terms in this range follows the relative magnitude-wise order of terms in a(0) .. a((2^(k-1))-1).
(B) For r in range (2^(k-1))+1 .. (2^k)-1, a((2^k)+r) = A000040(k+1) * a(r-1), and prime A000040(k) is present in the factorization.
Now it might be case that prime(k) > a product m of some subset of primes prime(k-1) .. prime(1). Even though the algorithm in those cases "would like" to divide by prime(k) instead of dividing by that product m, because then the divisor would be smaller, it cannot, because dividing by prime(k) (or by any other divisor containing it) would give an already used term.
(End)

Examples

			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)
		

Crossrefs

Cf. also A303761, A303762 (variants).

Programs

  • Mathematica
    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 *)
  • PARI
    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];

Formula

a(n) = A019565(A303767(n)).
a(n) = A019565(A052331(A303771(n))).
A052330(A048675(a(n))) = A303771(n).

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

Views

Author

Antti Karttunen, May 03 2018

Keywords

Comments

Each a(n+1) is either a divisor or a multiple of a(n).
The construction is otherwise like that of A303760, except here we choose the largest divisor instead of the smallest one. In contrast to A303760, this sequence is NOT permutation of A005117: 70 = A019565(13) is the first missing squarefree number. See also comments in A303769, A303749 and A302775.
Index of greatest prime factor of a(n) is monotonic and increments at n = {0, 1, 2, 4, 8, 15, 31, 50, 102, 157, 317, 480, 964, 1451, 2907, 4366, 8738, 13113, 26233, 39356, ...} - Michael De Vlieger, May 22 2018

Examples

			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)
		

Crossrefs

Subset of A005117.
Cf. A303760, A303761 (variants).

Programs

  • Mathematica
    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 *)
  • PARI
    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];

Formula

a(n) = A019565(A303769(n)). [Conjectured]

A303766 Inverse permutation to A303765.

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

Views

Author

Antti Karttunen, May 02 2018

Keywords

Crossrefs

Cf. A303765 (inverse).

Programs

Formula

For n >= 0, a(A000225(n)) = A300829(n).
Showing 1-6 of 6 results.