login
A200322
Related to numbers written in base 2 (see below for definition).
1
1, 1, 2, 3, 4, 5, 4, 7, 8, 9, 10, 9, 8, 9, 8, 15, 16, 17, 18, 17, 16, 21, 18, 17, 16, 17, 16, 19, 16, 17, 16, 31, 32, 33, 34, 33, 36, 33, 34, 33, 32, 33, 42, 33, 32, 37, 34, 33, 32, 33, 32, 35, 32, 33, 36, 35, 32, 33, 32, 35, 32, 33, 32, 63, 64
OFFSET
0,3
COMMENTS
Write b(k) as the first k+1 binary digits of n, and write c(k) as the last k+1 binary digits of n, for k=0..m where 2^m <= n < 2^(m+1). Set d(k) = 1 if b(k) = c(k) and d(k) = 0 otherwise. Then d(k) forms the binary digits of a(n): a(n) = Sum_{k=0..m} d(k)*2^k.
LINKS
EXAMPLE
n = 27 (in base 10) = 11011 (in base 2)
b(k) : 1 ; 11; 110; 1101; 11011
c(k) : 1 ; 11; 011; 1011; 11011
d(k) : 1 ; 1; 0; 0; 1
a(27) = 10011 (in base 2) = 19.
PROG
(PARI) {a(n)=local(B, m, b, c, d); B=binary(n); m=#B; d=vector(m); for(k=1, m, b=vector(k, j, B[j]); c=vector(k, j, B[m-k+j]); if(b==c, d[k]=1, d[k]=0)); subst(truncate(Ser(d)), x, 2)}
CROSSREFS
Sequence in context: A079867 A273290 A079869 * A361479 A075054 A158366
KEYWORD
nonn
AUTHOR
Philippe Deléham, Nov 16 2011
STATUS
approved