[go: up one dir, main page]

login
A105081
a(n) = 1 + A003188(n - 1), n >= 1.
5
1, 2, 4, 3, 7, 8, 6, 5, 13, 14, 16, 15, 11, 12, 10, 9, 25, 26, 28, 27, 31, 32, 30, 29, 21, 22, 24, 23, 19, 20, 18, 17, 49, 50, 52, 51, 55, 56, 54, 53, 61, 62, 64, 63, 59, 60, 58, 57, 41, 42, 44, 43, 47, 48, 46, 45, 37, 38, 40, 39, 35, 36, 34, 33, 97, 98, 100, 99, 103, 104, 102
OFFSET
1,2
COMMENTS
A permutation of the natural numbers.
FORMULA
a(1) = 1, a(2^k + j) = 2^k + a(2^k - j + 1) for 1 <= j <= 2^k.
A000069(a(n)) = A065621(n).
As a composition of related permutations:
a(n) = A268718(A003188(n)). - Antti Karttunen, Feb 14 2016
MATHEMATICA
Nest[Join[#, Length[#]+Reverse[#]]&, {1}, 7] (* Vladimir Joseph Stephan Orlovsky, Feb 01 2012 *)
PROG
(Scheme) (define (A105081 n) (+ 1 (A003188 (- n 1)))) ;; Antti Karttunen, Feb 14 2016
(Python)
def A105081(n): return 1+(n-1^ n-1>>1) # Chai Wah Wu, Jun 29 2022
CROSSREFS
Inverse permutation: A066194.
Sequence in context: A235201 A292958 A235493 * A235485 A026167 A361641
KEYWORD
nonn,easy,look
AUTHOR
Philippe Deléham, Apr 28 2005
STATUS
approved