(Translated by https://www.hiragana.jp/)
A304755 - OEIS
login
Suspected divisor-or-multiple permutation: a(1) = 1, and for n > 1, a(n) is either the second smallest divisor of a(n-1) not already present in sequence, or the smallest divisor if it is the only one not yet used, or (if all divisors have been already encountered), 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}.
5

%I #12 May 21 2018 11:28:30

%S 1,2,6,3,12,4,36,18,9,72,24,8,216,54,27,108,540,10,5,20,60,30,15,120,

%T 40,360,90,45,180,1260,14,7,28,84,42,21,168,56,504,126,63,252,6300,35,

%U 70,210,105,420,140,3780,189,378,1890,270,135,1080,7560,315,630,6930,22,11,44,132,66,33,264,88,792,198,99,396,1980,110,55

%N Suspected divisor-or-multiple permutation: a(1) = 1, and for n > 1, a(n) is either the second smallest divisor of a(n-1) not already present in sequence, or the smallest divisor if it is the only one not yet used, or (if all divisors have been already encountered), 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}.

%H Antti Karttunen, <a href="/A304755/b304755.txt">Table of n, a(n) for n = 1..65537</a>

%H <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>

%o (PARI)

%o up_to = 2^16;

%o A053669(n) = forprime(p=2, , if (n % p, return(p))); \\ From A053669

%o v304755 = vector(up_to);

%o m304756 = Map();

%o find_kth_unused_divisor(k,n,m_inverses) = { my(pd=0); fordiv(n,d,if(!mapisdefined(m_inverses,d),pd=d;k--); if((!k || (d == n)), return(pd))); };

%o prev=1; for(n=1,up_to, if((try = find_kth_unused_divisor(2,prev,m304756))!=0, mapput(m304756,v304755[n] = try,n), p = A053669(prev); while(mapisdefined(m304756,prev), prev *= p); v304755[n] = prev; mapput(m304756,prev,n)); prev = v304755[n]);

%o A304755(n) = v304755[n];

%o A304756(n) = mapget(m304756,n);

%Y Cf. A304756 (inverse).

%Y Cf. A053669, A304757.

%Y Cf. A303751, also A282291, A304531 for variants.

%K nonn

%O 1,2

%A _Antti Karttunen_, May 20 2018