%I #25 Sep 17 2023 01:36:22
%S 1,2,4,8,16,32,7,3,6,12,24,48,64,14,9,18,36,72,96,128,28,27,54,108,
%T 144,192,256,56,81,162,216,288,384,512,112,243,324,432,576,768,1024,
%U 224,486,648,864,1152,1536,2048,49,5,10,20,40,80,160,21,15,30,60,120
%N For p = 7 and n > 0, write n = p^m + k, m >= 0, with maximal p^m <= n, with 0 <= k < p^(m+1) - p^m, then for n such that k=0, a(n)=n, and for n such that k > 0, a(n) is the smallest q*a(k), prime q != p, that is not already a term.
%C This is sequence D(p), p = 7, where the Doudna sequence A005940 is D(2).
%H Michael De Vlieger, <a href="/A364628/b364628.txt">Table of n, a(n) for n = 1..16807</a>
%H <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%t p = 7; nn = 343; c[_] = False;
%t Do[Set[{m, k}, {1, n - p^Floor[Log[p, n]]}];
%t If[k == 0,
%t Set[{a[n], c[n]}, {n, True}],
%t While[Set[t, Prime[m] a[k]]; Or[m == i, c[t]], m++];
%t Set[{a[n], c[t]}, {t, True}]], {n, nn}];
%t Array[a, nn]
%Y Cf. A005940 (D(2)), A356867 (D(3)), A364611 (D(5)).
%K nonn
%O 1,2
%A _Michael De Vlieger_, Sep 16 2023