OFFSET
0,2
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
LINKS
Antti Karttunen, Table of n, a(n) for n = 0..8191 (first 1024 terms from Paul D. Hanna)
Michel Marcus, Peter Munn, et al, Discussion on SeqFan-list
FORMULA
EXAMPLE
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.
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 *)
PROG
(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)}
{a(n)=local(A=[1]); n++; for(n=1, 10, A=concat(A, A050376(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));
A003188(n) = bitxor(n, n>>1);
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Paul D. Hanna, Feb 21 2012
EXTENSIONS
Offset changed from 1 to 0 by Antti Karttunen, Apr 13 2018
STATUS
approved