login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Permutation of natural numbers: a(1) = 1; thereafter, if n is k-th number with an odd number of prime divisors (counted with multiplicity) [i.e., n = A026424(k)], a(n) = 2*a(k), otherwise, when n is k-th number > 1 with an even number of prime divisors [i.e., n = A028260(1+k)], a(n) = 1+(2*a(k)).
6

%I #15 Jan 14 2015 16:15:43

%S 1,2,4,3,8,5,6,16,9,7,10,12,32,17,11,13,18,14,20,24,33,19,64,15,21,25,

%T 34,22,26,36,28,40,65,35,23,27,48,37,29,41,66,38,128,30,42,49,50,68,

%U 67,44,39,52,72,129,31,43,51,69,56,45,80,53,130,73,57,70,46,54,81,96,74,58,82,131,132,76,71,256,60

%N Permutation of natural numbers: a(1) = 1; thereafter, if n is k-th number with an odd number of prime divisors (counted with multiplicity) [i.e., n = A026424(k)], a(n) = 2*a(k), otherwise, when n is k-th number > 1 with an even number of prime divisors [i.e., n = A028260(1+k)], a(n) = 1+(2*a(k)).

%H Antti Karttunen, <a href="/A245603/b245603.txt">Table of n, a(n) for n = 1..10001</a>

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

%F a(1) = 1, and for n > 1, if A066829(n) = 1, then a(n) = 2 * A245603(A055038(n)), otherwise a(n) = 1 + (2 * A245603(A055037(n)-1)).

%F As a composition of related permutations:

%F a(n) = A244321(A245613(n)).

%F For all n >= 1, A000035(a(n)) = 1 - A066829(n). [Permutation A143692 has the same property.]

%o (Scheme, with memoization macro definec)

%o (definec (A245603 n) (cond ((= 1 n) 1) ((= 1 (A066829 n)) (* 2 (A245603 (A055038 n)))) (else (+ 1 (* 2 (A245603 (-1+ (A055037 n))))))))

%Y Inverse: A245604.

%Y Cf. A026424, A028260, A066829, A055037, A055038.

%Y Similar permutations: A143692, A244152, A244321, A245613, A245605, A245607.

%K nonn

%O 1,2

%A _Antti Karttunen_, Jul 27 2014