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-9 of 9 results.

A303772 Inverse of A303771.

Original entry on oeis.org

0, 1, 3, 5, 9, 2, 17, 6, 33, 10, 65, 4, 129, 18, 12, 257, 513, 34, 1025, 14, 20, 66, 2049, 7, 4097, 130, 36, 22, 8193, 11, 16385, 258, 68, 514, 26, 38, 32769, 1026, 132, 15, 65537, 19, 131073, 70, 42, 2050, 262145, 260
Offset: 1

Views

Author

Antti Karttunen, May 02 2018

Keywords

Crossrefs

Programs

  • PARI
    default(parisizemax,2^31);
    up_to_e = 18;
    up_to = (2 + 2^up_to_e);
    v050376 = vector(2+up_to_e);
    A050376(n) = v050376[n];
    ispow2(n) = (n && !bitand(n,n-1));
    i = 0; for(n=1,oo,if(ispow2(isprimepower(n)), i++; v050376[i] = n); if(i == 2+up_to_e,break));
    A052330(n) = { my(p=1,i=1); while(n>0, if(n%2, p *= A050376(i)); i++; n >>= 1); (p); };
    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];
    A048675(n) = { my(f = factor(n)); sum(k=1, #f~, f[k, 2]*2^primepi(f[k, 1]))/2; };
    A303771(n) = A052330(A048675(A303760(n)));
    m303772 = Map();
    for(n=0,up_to-1,mapput(m303772,A303771(n),n));
    A303772(n) = mapget(m303772,n);

Formula

a(n) = A303768(A052331(n)).

A303767 May code of n: a(0) = 0, and for n > 0, if n = 2^k, a(n) = n + a(n-1), otherwise, when n = 2^k + r (with 0 < r < 2^k), then a(n) = 2^k + a(r-1); see comments for equivalent alternative descriptions.

Original entry on oeis.org

0, 1, 3, 2, 6, 4, 5, 7, 15, 8, 9, 11, 10, 14, 12, 13, 29, 16, 17, 19, 18, 22, 20, 21, 23, 31, 24, 25, 27, 26, 30, 28, 60, 32, 33, 35, 34, 38, 36, 37, 39, 47, 40, 41, 43, 42, 46, 44, 45, 61, 48, 49, 51, 50, 54, 52, 53, 55, 63, 56, 57, 59, 58, 62, 126, 64, 65, 67, 66, 70, 68, 69, 71, 79, 72, 73, 75, 74, 78, 76, 77, 93, 80, 81
Offset: 0

Views

Author

Antti Karttunen, May 02 2018

Keywords

Comments

This is also "minimal subset/superset bitmask" transform of the nonnegative integers, A001477. In that transform, applicable to any N -> N injection f, we start from a(0) = 0, after which 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 for which f(k_i) is minimized; otherwise, a(n) = that h_i for which f(h_i) is minimized among the infinite set of numbers h_i for which bitand(h_i,a(n-1)) = a(n-1) and that are not yet present in the sequence. In this case f(n) = A001477(n) = n.
The original, equivalent definition is:
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 toggling a single 0-bit of a(n-1) to 1. This is done by trying to toggle successive vacant bits from the least significant end of the binary representation of a(n-1), until such a sum a(n-1) + 2^h (= a(n-1) bitxor 2^h) is found that is not already present in the sequence.
Shares with permutations like A003188, A006068, A300838, A302846, A303765 and A304083 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.
Also, like A003188, A006068 and many other base-2 representation related permutations, this permutation preserves the binary size of n (A000523(n)), and furthermore, a(n) seems to stay at most points (except at powers of 2) remarkably close to n.
From Antti Karttunen, May 23 2018: (Start)
Outline of the proof that the definition involving A019565 is equivalent to the recurrent formula:
Even though A019565 is nonmonotonic, for example A019565(4) = 5 = p_3 < A019565(3) = 6 = p_1 * p_2, and in general, although there are always primes p_k < p_{i1} * p_{i2} * ... * p_{ih}, with i1, i2, ..., ih < k, it doesn't matter here, because not just the position of the most significant 1-bit is monotonic in this sequence (see the binary representation at A304747), but also in each subrange (2^k)+2 .. (2^(k+1))-1 the position of the second most significant 1-bit moves only leftward, i.e., is monotonic, which follows from the recursive formula.
To see this, consider the first time in this sequence when in a batch of terms (of equal binary width) we have bits in position k (the most significant position) and (k-1) on (that is, both are 1's), the latter corresponding to prime p_k: while in principle a bit-based rule could choose to subtract 2^(k-1), in preference to any 1-bits to the right of it (that correspond to primes p_{i1} .. p_{ih}), it cannot do so at this stage, because it is the second most significant 1-bit, and then it would not move only leftward, contradicting what was said above. Neither this can occur later when more 1-bits have appeared to their left: the recursive formula guarantees it.
Also conversely, even though p_4 = 7 > 6 = p_1 * p_2, and in general, we always have such prime p_k > p_{i1} * p_{i2} * ... * p_{ih}, with i1, i2, ..., ih < k, and while here A019565-based rule (see comments in A303760) would prefer dividing p_k out instead of any subset of p_{i1} .. p_{ih}, it happens that in that rule, the index of the largest prime (A061395) grows monotonically, so at the stage where p_k is the largest prime of the batch of length 2^(k-1), p_k just cannot be divided out, and also here the structure of the later batches is strictly determined by recursion.
(End)

Examples

			From _Michael De Vlieger_, May 23 2018: (Start)
Table below shows the initial 17 terms at right. First column is index n,
second shows "." if A303760(n) = largest divisor of A303760(n-1), or factor p.
   n     p\d  m=A303760(n)  A054841(m)    a(n)
  -------------------------------------------
   0       .        1               0       0
   1       2        2               1       1
   2       3        6              11       3
   3       .        3              10       2
   4       5       15             110       6
   5       .        5             100       4
   6       2       10             101       5
   7       3       30             111       7
   8       7      210            1111      15
   9       .        7            1000       8
  10       2       14            1001       9
  11       3       42            1011      11
  12       .       21            1010      10
  13       5      105            1110      14
  14       .       35            1100      12
  15       2       70            1101      13
  16      11      770           11101      29
  ...  (End)
		

Crossrefs

Cf. A303768 (inverse), A304747 (terms shown in base-2).
Cf. also A303763, A303765, A303769, A303775, A304083 (similar sequences).

Programs

  • Mathematica
    Map[FromDigits[#, 2] &@ Reverse@ If[# == 1, {0}, Function[f, ReplacePart[Table[0, {PrimePi[f[[-1, 1]]]}], #] &@ Map[PrimePi@ First@ # -> Last@ # &, f]]@ FactorInteger@ #] &@# &, 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}, 83]] (* Michael De Vlieger, May 23 2018 *)
  • PARI
    A209229(n) = (n && !bitand(n,n-1));
    A053644(n) = { my(k=1); while(k<=n, k<<=1); (k>>1); }; \\ From A053644
    A303767(n) = if(!n,n,if(A209229(n),n+A303767(n-1),A053644(n)+A303767(n-A053644(n)-1))); \\ Program based on new recurrence added May 06 2018
    
  • 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; };
    v303767 = vector(up_to);
    m303768 = Map();
    w=1; for(n=1,up_to,s = Set([]); for(m=1,w, if((bitor(w,m)==w) && !mapisdefined(m303768,m), s = setunion(Set([A019565(m)]),s))); if(length(s)>0, w = A048675(vecmin(s)), b=A006519(1+w); while(bitand(w,b) || mapisdefined(m303768,w+b), b <<= 1); w += b); v303767[n] = w; mapput(m303768,w,n));
    A303767(n) = if(!n,n,v303767[n]);
    A303768(n) = if(!n,n,mapget(m303768,n));

Formula

a(0) = 0, and for n > 0, if n = 2^k, a(n) = n + a(n-1), otherwise, when n = 2^k + r (with 0 < r < 2^k), then a(n) = 2^k + a(r-1). \\ Antti Karttunen, May 06 2018
a(n) = A048675(A303760(n)).
a(n) = A052331(A303771(n)).
For all n >= 1, A000523(a(n)) = A000523(n), A007088(a(n)) = A304747(n).

Extensions

Name replaced with an equivalent, but simpler definition by Antti Karttunen, May 06 2018

A207901 Let S_k denote the first 2^k terms of this sequence and let b_k be the smallest positive integer that is not in S_k, also let R_k equal S_k read in reverse order; then the numbers b_k*R_k are the next 2^k terms.

Original entry on oeis.org

1, 2, 6, 3, 12, 24, 8, 4, 20, 40, 120, 60, 15, 30, 10, 5, 35, 70, 210, 105, 420, 840, 280, 140, 28, 56, 168, 84, 21, 42, 14, 7, 63, 126, 378, 189, 756, 1512, 504, 252, 1260, 2520, 7560, 3780, 945, 1890, 630, 315, 45, 90, 270, 135, 540, 1080, 360, 180, 36, 72, 216
Offset: 0

Views

Author

Paul D. Hanna, Feb 21 2012

Keywords

Comments

A permutation of the positive integers (but please note the starting offset: 0-indexed).
This sequence is a variant of A052330.
Shares with A064736, A302350, etc. the property that a(n) is either a divisor or a multiple of a(n+1). - Peter Munn, Apr 11 2018 on SeqFan-list. Note: A302781 is another such "divisor-or-multiple permutation" satisfying the same property. - Antti Karttunen, Apr 14 2018
The offset is 0 since S_0 = {1} denotes the first 2^0 = 1 terms. - Daniel Forgues, Apr 13 2018
This is "Fermi-Dirac piano played with Gray code", as indicated by Peter Munn's Apr 11 2018 formula. Compare also to A303771 and A302783. - Antti Karttunen, May 16 2018

Examples

			Start with [1]; appending 2*[1] results in [1,2];
appending 3*[2,1] results in [1,2, 6,3];
appending 4*[3,6,2,1] results in [1,2,6,3, 12,24,8,4];
appending 5*[4,8,24,12,3,6,2,1]
results in [1,2,6,3,12,24,8,4, 20,40,120,60,15,30,10,5];
next append 7*[5,10,30,15,60,120,40,20,4,8,24,12,3,6,2,1],
multiplying by 7 since 6 is already found in the previous terms.
Each new factor is in A050376: [2,3,4,5,7,9,11,13,16,17,19,23,25,29,...].
Continue in this way to generate all the terms of this sequence.
		

Crossrefs

Cf. A064736, A281978, A282291, A302350, A302781, A302783, A303751, A303771, A304085, A304531, A304755 for other divisor-or-multiple permutations or conjectured permutations.
Cf. A302033 (a squarefree analog), A304745.

Programs

  • Mathematica
    a = {1}; Do[a = Join[a, Reverse[a]*Min[Complement[Range[Max[a] + 1], a]]], {n, 1, 6}]; a (* Ivan Neretin, May 09 2015 *)
  • PARI
    {A050376(n)= local(m, c, k, p); n--; if(n<=0, 2*(n==0), c=0; m=2; while( cA050376(n-1)*Vec(Polrev(A))));A[n]}
    for(n=0,63,print1(a(n),",")) \\ edited for offsets by Michel Marcus, Apr 04 2019
    
  • PARI
    up_to_e = 13;
    v050376 = vector(up_to_e);
    A050376(n) = v050376[n];
    ispow2(n) = (n && !bitand(n,n-1));
    i = 0; for(n=1,oo,if(ispow2(isprimepower(n)), i++; v050376[i] = n); if(i == up_to_e,break));
    A052330(n) = { my(p=1,i=1); while(n>0, if(n%2, p *= A050376(i)); i++; n >>= 1); (p); };
    A003188(n) = bitxor(n, n>>1);
    A207901(n) = A052330(A003188(n)); \\ Antti Karttunen, Apr 13 2018

Formula

a(n) = A052330(A003188(n)). - Peter Munn, Apr 11 2018
a(n) = A302781(A302843(n)) = A302783(A064706(n)). - Antti Karttunen, Apr 16 2018
a(n+1) = A059897(a(n), A050376(A001511(n+1))). - Peter Munn, Apr 01 2019

Extensions

Offset changed from 1 to 0 by Antti Karttunen, Apr 13 2018

A302781 Divisor-or-multiple permutation of natural numbers constructed from two-dimensional Hilbert curve (A163357) and Fermi-Dirac primes (A050376).

Original entry on oeis.org

1, 2, 6, 3, 15, 5, 10, 30, 120, 40, 20, 60, 12, 24, 8, 4, 28, 84, 168, 56, 14, 7, 21, 42, 210, 105, 35, 70, 280, 840, 420, 140, 1260, 3780, 7560, 2520, 630, 315, 945, 1890, 378, 189, 63, 126, 504, 1512, 756, 252, 36, 72, 216, 108, 540, 180, 360, 1080, 270, 90, 45, 135, 27, 54, 18, 9, 117, 351, 702, 234, 936, 468
Offset: 0

Views

Author

Antti Karttunen, Apr 14 2018

Keywords

Comments

Note that the starting offset is 0, to align with A052330 and A207901.
Shares with A064736, A207901, A298480, A302350, A302783, A303771, etc. the property that a(n) is either a divisor or a multiple of a(n+1). Permutations satisfying such property are called "divisor-or-multiple permutations" in the OEIS, although Mazet & Saias call them "chain permutations" in their paper. [Edited by Antti Karttunen, Aug 26 2018]
One way to construct such permutations is by composing A052330 from the right with any such permutation like A003188 or A302846 where the binary expansions of a(n) and a(n+1) always differ by just a single bit-position.
Further permutations satisfying the same condition could be constructed from higher-dimensional versions (i.e., greater than 2) of Hilbert's space-filling curves, where the coordinates of each dimension would be Gray coded separately and then interleaved together. Permutation A207901 is essentially a one-dimensional variant of the same idea, while this is constructed from the 2-dimensional curve A163357, which is a Hamiltonian path on N X N grid.
See Peter Munn's A300012 for another idea for constructing such a permutation. - Antti Karttunen, Aug 26 2018

Crossrefs

Programs

  • PARI
    up_to_e = 14;
    v050376 = vector(up_to_e);
    A050376(n) = v050376[n];
    ispow2(n) = (n && !bitand(n,n-1));
    i = 0; for(n=1,oo,if(ispow2(isprimepower(n)), i++; v050376[i] = n); if(i == up_to_e,break));
    A052330(n) = { my(p=1,i=1); while(n>0, if(n%2, p *= A050376(i)); i++; n >>= 1); (p); };
    A064706(n) = bitxor(n, n>>2);
    A057300(n) = { my(t=1,s=0); while(n>0, if(1==(n%4),n++,if(2==(n%4),n--)); s += (n%4)*t; n >>= 2; t <<= 2); (s); };
    A163356(n) = if(!n,n,my(i = (#binary(n)-1)\2, f = 4^i, d = (n\f)%4, r = (n%f)); (((((2+(i%2))^d)%5)-1)*f) + if(3==d,f-1-A163356(r),A057300(A163356(r))));
    A302781(n) = A052330(A064706(A163356(n)));

Formula

a(n) = A052330(A302846(n)), where A302846(n) = A000695(A003188(A059253(n))) + 2*A000695(A003188(A059252(n))).

Extensions

Name edited by Antti Karttunen, Aug 26 2018

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).

A304085 Divisor-or-multiple permutation of natural numbers: a(n) = A052330(A304083(n)).

Original entry on oeis.org

1, 2, 6, 3, 24, 12, 4, 8, 120, 60, 20, 5, 40, 10, 30, 15, 840, 420, 140, 35, 7, 280, 70, 14, 210, 105, 21, 168, 84, 28, 56, 7560, 42, 1890, 945, 315, 63, 9, 3780, 1260, 252, 36, 2520, 630, 126, 18, 1512, 756, 189, 27, 378, 54, 1080, 540, 180, 45, 360, 90, 270, 135, 83160, 504, 72, 216, 108, 41580, 13860, 3465, 693, 99, 11, 27720, 6930, 1386, 198, 22, 20790
Offset: 0

Views

Author

Antti Karttunen, May 06 2018

Keywords

Comments

Each a(n) is always either a divisor or a multiple of a(n+1).

Crossrefs

Cf. A304086 (inverse).
Cf. also A064736, A113552, A207901, A281978, A282291, A302350, A302781, A302783, A303751, A303771 for similar permutations.

Programs

  • PARI
    up_to_e = 16; \\ Good for computing up to n = (2^16)-1
    v050376 = vector(up_to_e);
    ispow2(n) = (n && !bitand(n,n-1));
    i = 0; for(n=1,oo,if(ispow2(isprimepower(n)), i++; v050376[i] = n); if(i == up_to_e,break));
    A050376(n) = v050376[n];
    A052330(n) = { my(p=1,i=1); while(n>0, if(n%2, p *= A050376(i)); i++; n >>= 1); (p); };
    A304085(n) = A052330(A304083(n)); \\ Needs also code from A304083

Formula

a(n) = A052330(A304083(n)).

A304537 Suspected divisor-or-multiple permutation of squarefree numbers: a(n) = A019565(A304533(n)).

Original entry on oeis.org

1, 2, 6, 3, 15, 5, 65, 13, 26, 182, 7, 14, 42, 21, 105, 35, 455, 91, 910, 10, 30, 210, 70, 2730, 39, 78, 546, 273, 1365, 195, 7995, 41, 82, 246, 123, 615, 205, 2665, 533, 1066, 11726, 11, 22, 66, 33, 165, 55, 715, 143, 286, 2002, 77, 154, 462, 231, 1155, 385, 5005, 1001, 10010, 110, 330, 2310, 770, 30030, 429, 858, 6006, 3003, 15015, 2145, 87945, 451, 902
Offset: 0

Views

Author

Antti Karttunen, May 15 2018

Keywords

Comments

Each a(n) is always either a divisor or a multiple of a(n+1).
Consider A052330. Imagine that it is an automatic piano that "plays sequences" when an appropriate punched "tape" is fed to it (as its input), i.e., when it is composed from the right with an appropriate sequence p, as A019565(p(n)). The 1-bits in the binary expansion of each p(n) are the "holes" in the tape, and they determine which "tunes" are present on beat n. The "tunes" are actually "Fermi-Dirac primes" (A050376) that are multiplied together.
If the tape is constructed in such a way that between the successive beats (when moving from p(n) to p(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 occur simultaneously, then when fed as an input to this piano, the resulting sequence "s" (the output) is guaranteed to satisfy the condition that s(n+1) is either a multiple or a divisor of s(n). Furthermore, if the given sequence p is itself a permutation of natural numbers, then also the produced sequence is. For example, Gray code A003188 and its inverse A006068 are such sequences, and when given as an "input tape" for A052330, they produce permutations A207901 and A302783.
There is a simpler instrument, called "squarefree piano" (A019565), with which it is possible to produce similar divisor-or-multiple sequences, but that contain only squarefree numbers. Given A003188 or A006068 as an input tape for it produces correspondingly sequences A302033 and A284003.
This sequence is obtained by playing "squarefree piano" with the same tape which yields A304531 when "Fermi-Dirac piano" is played with it. However, in this case the sequence A304531 is produced by a greedy algorithm, and thus its tape (A304533) is actually a back-formation, obtained from the "music" (A304531) by applying "tape-recorder" (A052331) to it. Note that this in not a subsequence of A304531, as the terms occur in different order than the squarefree terms of A304531.
See also Peter Munn's Apr 11 2018 message on SeqFan-mailing list.

Crossrefs

Programs

Formula

a(n) = A019565(A304533(n)) = A019565(A052331(A304531(1+n))).

A366254 Binary weight of May code (A303767).

Original entry on oeis.org

0, 1, 2, 1, 2, 1, 2, 3, 4, 1, 2, 3, 2, 3, 2, 3, 4, 1, 2, 3, 2, 3, 2, 3, 4, 5, 2, 3, 4, 3, 4, 3, 4, 1, 2, 3, 2, 3, 2, 3, 4, 5, 2, 3, 4, 3, 4, 3, 4, 5, 2, 3, 4, 3, 4, 3, 4, 5, 6, 3, 4, 5, 4, 5, 6, 1, 2, 3, 2, 3, 2, 3, 4, 5, 2, 3, 4, 3, 4, 3, 4, 5, 2, 3, 4, 3, 4, 3, 4, 5, 6, 3, 4, 5, 4, 5, 4, 5, 2, 3, 4, 3, 4, 3, 4, 5
Offset: 0

Views

Author

Antti Karttunen, Oct 05 2023

Keywords

Crossrefs

Programs

Formula

a(n) = A000120(A303767(n)).
a(n) = A001221(A303760(n)) = A001222(A303760(n)) = A001222(A366261(n)).
a(n) = A064547(A303771(n)).
Showing 1-9 of 9 results.