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

A270201
Permutation of natural numbers: a(1) = 1, a(A270189(1+n)) = 2 * a(n), a(A270190(n)) = 1 + 2*a(n).
4
1, 2, 4, 8, 16, 32, 64, 128, 3, 256, 5, 6, 512, 10, 9, 17, 12, 33, 1024, 20, 65, 18, 129, 34, 24, 66, 2048, 40, 130, 36, 258, 257, 68, 48, 132, 7, 513, 4096, 11, 13, 80, 260, 72, 516, 514, 1025, 21, 136, 96, 264, 19, 14, 1026, 35, 25, 67, 8192, 2049, 22, 26, 160, 520, 144, 1032, 1028, 2050, 41, 42, 272, 192, 131, 528, 37, 259, 38, 69, 28
OFFSET
1,2
FORMULA
a(1) = 1, for n > 1, if A137264(n) = 0 [when n is in A270190], a(n) = 1 + 2*a(A269850(n)), otherwise a(n) = 2 * a(A269849(n)-1).
PROG
(Scheme, with memoization-macro definec)
(definec (A270201 n) (cond ((= 1 n) n) ((not (zero? (A137264 n))) (* 2 (A270201 (+ -1 (A269849 n))))) (else (+ 1 (* 2 (A270201 (A269850 n)))))))
CROSSREFS
Inverse: A270202.
Similar permutation: A270193.
Sequence in context: A243085 A060376 A047869 * A016025 A036161 A036159
KEYWORD
nonn
AUTHOR
Antti Karttunen, Mar 16 2016
STATUS
approved