%I #80 Dec 23 2024 14:53:43
%S 1,2,6,3,12,24,8,4,20,40,120,60,15,30,10,5,35,70,210,105,420,840,280,
%T 140,28,56,168,84,21,42,14,7,63,126,378,189,756,1512,504,252,1260,
%U 2520,7560,3780,945,1890,630,315,45,90,270,135,540,1080,360,180,36,72,216
%N 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.
%C A permutation of the positive integers (but please note the starting offset: 0-indexed).
%C This sequence is a variant of A052330.
%C 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
%C The offset is 0 since S_0 = {1} denotes the first 2^0 = 1 terms. - _Daniel Forgues_, Apr 13 2018
%C 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
%H Antti Karttunen, <a href="/A207901/b207901.txt">Table of n, a(n) for n = 0..8191</a> (first 1024 terms from Paul D. Hanna)
%H Michel Marcus, Peter Munn, et al, <a href="https://web.archive.org/web/*/http://list.seqfan.eu/oldermail/seqfan/2018-April/018581.html">Discussion on SeqFan-list</a>
%H <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%F a(n) = A052330(A003188(n)). - _Peter Munn_, Apr 11 2018
%F a(n) = A302781(A302843(n)) = A302783(A064706(n)). - _Antti Karttunen_, Apr 16 2018
%F a(n+1) = A059897(a(n), A050376(A001511(n+1))). - _Peter Munn_, Apr 01 2019
%e Start with [1]; appending 2*[1] results in [1,2];
%e appending 3*[2,1] results in [1,2, 6,3];
%e appending 4*[3,6,2,1] results in [1,2,6,3, 12,24,8,4];
%e appending 5*[4,8,24,12,3,6,2,1]
%e results in [1,2,6,3,12,24,8,4, 20,40,120,60,15,30,10,5];
%e next append 7*[5,10,30,15,60,120,40,20,4,8,24,12,3,6,2,1],
%e multiplying by 7 since 6 is already found in the previous terms.
%e Each new factor is in A050376: [2,3,4,5,7,9,11,13,16,17,19,23,25,29,...].
%e Continue in this way to generate all the terms of this sequence.
%t a = {1}; Do[a = Join[a, Reverse[a]*Min[Complement[Range[Max[a] + 1], a]]], {n, 1, 6}]; a (* _Ivan Neretin_, May 09 2015 *)
%o (PARI) {A050376(n)= local(m, c, k, p); n--; if(n<=0, 2*(n==0), c=0; m=2; while( c<n, m++; if( isprime(m) || ( (k=ispower(m,, &p))&&isprime(p)&& k ==2^valuation(k, 2) ), c++)); m)}
%o {a(n)=local(A=[1]); n++; for(n=1,10,A=concat(A,A050376(n-1)*Vec(Polrev(A))));A[n]}
%o for(n=0,63,print1(a(n),",")) \\ edited for offsets by _Michel Marcus_, Apr 04 2019
%o (PARI)
%o up_to_e = 13;
%o v050376 = vector(up_to_e);
%o A050376(n) = v050376[n];
%o ispow2(n) = (n && !bitand(n,n-1));
%o i = 0; for(n=1,oo,if(ispow2(isprimepower(n)), i++; v050376[i] = n); if(i == up_to_e,break));
%o A052330(n) = { my(p=1,i=1); while(n>0, if(n%2, p *= A050376(i)); i++; n >>= 1); (p); };
%o A003188(n) = bitxor(n, n>>1);
%o A207901(n) = A052330(A003188(n)); \\ _Antti Karttunen_, Apr 13 2018
%Y Cf. A001511, A003188, A052330, A050376, A059897, A064706, A302029 (inverse), A302843.
%Y Cf. A064736, A281978, A282291, A302350, A302781, A302783, A303751, A303771, A304085, A304531, A304755 for other divisor-or-multiple permutations or conjectured permutations.
%Y Cf. A302033 (a squarefree analog), A304745.
%K nonn,look
%O 0,2
%A _Paul D. Hanna_, Feb 21 2012
%E Offset changed from 1 to 0 by _Antti Karttunen_, Apr 13 2018