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”).

A245603
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
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, 34, 22, 26, 36, 28, 40, 65, 35, 23, 27, 48, 37, 29, 41, 66, 38, 128, 30, 42, 49, 50, 68, 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
OFFSET
1,2
FORMULA
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)).
As a composition of related permutations:
a(n) = A244321(A245613(n)).
For all n >= 1, A000035(a(n)) = 1 - A066829(n). [Permutation A143692 has the same property.]
PROG
(Scheme, with memoization macro definec)
(definec (A245603 n) (cond ((= 1 n) 1) ((= 1 (A066829 n)) (* 2 (A245603 (A055038 n)))) (else (+ 1 (* 2 (A245603 (-1+ (A055037 n))))))))
CROSSREFS
Inverse: A245604.
Similar permutations: A143692, A244152, A244321, A245613, A245605, A245607.
Sequence in context: A098709 A054238 A225589 * A371591 A048679 A342794
KEYWORD
nonn
AUTHOR
Antti Karttunen, Jul 27 2014
STATUS
approved