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

A277695
Permutation of natural numbers: a(1) = 1; for n > 1, if A277815(n) = 0, a(n) = 2*a(A277814(n)-1), otherwise a(n) = 1 + 2*a(A277815(n)).
6
1, 2, 4, 8, 3, 16, 6, 32, 12, 5, 13, 64, 7, 24, 10, 26, 128, 14, 27, 17, 25, 49, 48, 20, 257, 11, 21, 52, 15, 256, 28, 54, 34, 50, 55, 98, 515, 99, 9, 65, 31, 29, 97, 105, 51, 96, 40, 514, 22, 101, 43, 35, 1031, 513, 81, 42, 69, 23, 57, 104, 63, 30, 512, 56, 108, 68, 111, 100, 139, 199, 163, 110, 196, 203, 19, 211, 2063, 33, 195, 53, 1030, 47
OFFSET
1,2
FORMULA
a(1) = 1; for n > 1, if A277815(n) = 0 [when n is in A277817], a(n) = 2*a(A277814(n)-1), otherwise a(n) = 1 + 2*a(A277815(n)).
a(1) = 1, a(A277817(1+n)) = 2*a(n), a(A277816(n)) = 1 + 2*a(n). [Implicit form.]
PROG
(Scheme, with memoization-macro definec)
(definec (A277695 n) (cond ((= 1 n) n) ((zero? (A277815 n)) (* 2 (A277695 (+ -1 (A277814 n))))) (else (+ 1 (* 2 (A277695 (A277815 n)))))))
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Nov 06 2016
STATUS
approved