%I #9 Nov 07 2016 09:10:21
%S 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,
%T 11,21,52,15,256,28,54,34,50,55,98,515,99,9,65,31,29,97,105,51,96,40,
%U 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
%N 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)).
%H Antti Karttunen, <a href="/A277695/b277695.txt">Table of n, a(n) for n = 1..10000</a>
%H <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%F 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)).
%F a(1) = 1, a(A277817(1+n)) = 2*a(n), a(A277816(n)) = 1 + 2*a(n). [Implicit form.]
%o (Scheme, with memoization-macro definec)
%o (definec (A277695 n) (cond ((= 1 n) n) ((zero? (A277815 n)) (* 2 (A277695 (+ -1 (A277814 n))))) (else (+ 1 (* 2 (A277695 (A277815 n)))))))
%Y Inverse: A277696.
%Y Cf. A264977, A277710, A277814, A277815, A277816, A277817.
%K nonn
%O 1,2
%A _Antti Karttunen_, Nov 06 2016
|