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

A227413
a(1)=1, a(2n)=nthprime(a(n)), a(2n+1)=nthcomposite(a(n)), where nthprime = A000040, nthcomposite = A002808.
34
1, 2, 4, 3, 6, 7, 9, 5, 8, 13, 12, 17, 14, 23, 16, 11, 10, 19, 15, 41, 22, 37, 21, 59, 27, 43, 24, 83, 35, 53, 26, 31, 20, 29, 18, 67, 30, 47, 25, 179, 58, 79, 34, 157, 54, 73, 33, 277, 82, 103, 40, 191, 62, 89, 36, 431, 114, 149, 51, 241, 75, 101, 39, 127, 46
OFFSET
1,2
COMMENTS
Inverse permutation of A135141.
Shares with A073846 the property that the other bisection consists of just primes and the other bisection of just nonprimes.
FORMULA
a(1)=1, a(2n) = A000040(a(n)), a(2n+1) = A002808(a(n)).
A007097(n) = a(A000079(n)).
PROG
(Scheme, with Antti Karttunen's IntSeq-library)
(definec (A227413 n) (cond ((< n 2) n) ((even? n) (A000040 (A227413 (/ n 2)))) (else (A002808 (A227413 (/ (- n 1) 2))))))
(Haskell)
import Data.List (transpose)
a227413 n = a227413_list !! (n-1)
a227413_list = 1 : concat (transpose [map a000040 a227413_list,
map a002808 a227413_list])
-- Reinhard Zumkeller, Jan 29 2014
CROSSREFS
Similarly constructed permutations: A227402, A227404, A227410, A227412. Cf. also A073846, A209636.
Sequence in context: A367262 A358467 A006016 * A217122 A239622 A245604
KEYWORD
nonn,look
AUTHOR
Antti Karttunen, Jul 10 2013
STATUS
approved