login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

a(n) = (A268670(n)+1) / 2.
7

%I #8 Feb 13 2016 23:16:24

%S 1,2,1,4,1,2,3,8,3,2,7,4,5,6,1,16,1,6,15,4,13,14,5,8,9,10,3,12,7,2,11,

%T 32,11,2,31,12,29,30,7,8,25,26,9,28,3,10,27,16,17,18,1,20,15,6,19,24,

%U 5,14,23,4,21,22,13,64,13,22,63,4,61,62,21,24,57,58,5,60,23,14,59,16,49,50,17,52,1

%N a(n) = (A268670(n)+1) / 2.

%H Antti Karttunen, <a href="/A268671/b268671.txt">Table of n, a(n) for n = 1..13107</a>

%F a(n) = (A268670(n)+1) / 2.

%t f[n_] := Fold[BitXor, n, Quotient[n, 2^Range[BitLength@ n - 1]]]; g[n_] := If[OddQ@ #, n, g[#/2]] &@ f[n]; Table[(f@ g@ n + 1)/2, {n, 85}] (* _Michael De Vlieger_, Feb 12 2016, after _Jan Mangaldan_ at A006068 *)

%o (Scheme) (define (A268671 n) (/ (+ 1 (A268670 n)) 2))

%Y Cf. A001317 (positions of ones).

%Y Cf. A268669, A268670.

%K nonn,base

%O 1,2

%A _Antti Karttunen_, Feb 10 2016