For each positive integer n, let A(n) be the number of digits in the binary representation of n, and let B(n) be the number of ones in the binary representation of n. What is the value of S:
S = (1/2)^[A(1)+B(1)] + (1/2)^[A(2)+B(2)] + (1/2)^[A(3)+B(3)] + ...