0,3

Table of n, a(n) for n=0..69.

Index entries for sequences that are permutations of the natural numbers

a(0)=0, if n=2^k, a(n) = n, if n=2^k + i (with i > 0 and i < 2^k), a(n) = 2^(k+1) - i = 2*A053644(n) - A053645(n).

(Scheme:) (define (A122155 n) (cond ((< n 1) n) ((pow2? n) n) (else (- (* 2 (A053644 n)) (A053645 n)))))

(define (pow2? n) (and (> n 0) (zero? (A004198bi n (- n 1)))))

Cf. A054429, A122198, A122199.

Sequence in context: A299327 A231551 A122198 * A106454 A270195 A297441

Adjacent sequences: A122152 A122153 A122154 * A122156 A122157 A122158

nonn

Antti Karttunen, Aug 25 2006

approved