login
For n=1,2,3,..., define b(n) as follows: initialize v at v=n; then for k=2,3,4,..., if v>0 and k divides v, replace v with v-k. Set b(n)=v. Then {a(n)} is the subsequence consisting of the nonzero terms of {b(n)}.
1

%I #27 Apr 24 2024 08:08:38

%S 1,2,3,4,5,7,6,8,11,10,13,9,17,12,19,14,23,16,20,15,29,31,22,18,25,21,

%T 26,37,24,41,43,27,34,28,47,32,38,53,35,40,33,59,44,30,61,46,49,50,39,

%U 67,42,71,36,73,58,55,79,52,48,62,83,65,51,45,89,56,57,74,97,101,103

%N For n=1,2,3,..., define b(n) as follows: initialize v at v=n; then for k=2,3,4,..., if v>0 and k divides v, replace v with v-k. Set b(n)=v. Then {a(n)} is the subsequence consisting of the nonzero terms of {b(n)}.

%C A permutation of the positive integers.

%H Ivan Neretin, <a href="/A066937/b066937.txt">Table of n, a(n) for n = 1..10000</a>

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

%t terms = 71; m0 = 400; dm = 200; Clear[f]; f[m_] := f[m] = (r = Range[m]; Do[r = r /. {n_ /; n > 0 && Mod[n, k] == 0 :> n - k }, {k, 2, Floor[m/2]}]; DeleteCases[r, 0] [[1 ;; terms]]); f[m0]; f[m = m0 + dm]; While[f[m] != f[m - dm], m = m + dm]; f[m] (* _Jean-François Alcover_, Mar 20 2013 *)

%K nonn

%O 1,2

%A _John W. Layman_, Jan 24 2002