login
a(0) = 0; for n >= 1: if n = A153880(k) for some k, then a(n) = 2*a(k), otherwise, n = A273670(h) for some h, and a(n) = 1 + 2*a(h).
4

%I #6 May 30 2016 18:24:56

%S 0,1,2,3,5,7,4,11,6,15,9,23,10,13,14,31,19,47,21,27,29,63,39,95,8,43,

%T 22,55,59,127,12,79,30,191,17,87,18,45,46,111,119,255,25,159,61,383,

%U 35,175,20,37,26,91,93,223,28,239,62,511,51,319,38,123,94,767,71,351,41,75,53,183,187,447,42,57,54,479,125,1023,58

%N a(0) = 0; for n >= 1: if n = A153880(k) for some k, then a(n) = 2*a(k), otherwise, n = A273670(h) for some h, and a(n) = 1 + 2*a(h).

%H Antti Karttunen, <a href="/A273665/b273665.txt">Table of n, a(n) for n = 0..5040</a>

%H <a href="/index/Fa#facbase">Index entries for sequences related to factorial base representation</a>

%H <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>

%F a(0) = 0; for n >= 1: if A257680(A225901(n)) = 0 [i.e., n is one of the terms of A153880], then a(n) = 2*a(A266193(n)), otherwise [when n is one of the terms of A273670], a(n) = 1 + 2*a(A273663(n)).

%o (Scheme, with memoization-macro definec)

%o (definec (A273665 n) (cond ((zero? n) n) ((zero? (A257680 (A225901 n))) (* 2 (A273665 (A266193 n)))) (else (+ 1 (* 2 (A273665 (A273663 n)))))))

%Y Inverse: A273666.

%Y Cf. A153880, A225901, A257680, A266193, A273663, A273670.

%Y Related or similar permutations: A255565, A273667.

%K nonn,base

%O 0,3

%A _Antti Karttunen_, May 30 2016