第 663 题:(2003 AIME I, 13)
Let $N$ be the number of positive integers that are less than or equal to 2003 and whose base-2 representation has more 1's than 0's. Find the remainder when $N$ is divided by 1000.
- A $k$-digit binary number starts with $1$; it has more $1$'s than $0$'s when the other $k-1$ digits have $j$ ones with $1+j>k-1-j$. For $k=1,\dots,11$ the counts are $1,1,3,4,11,16,42,64,163,256,638$; in total $1199$ numbers up to $2047$.
- $2003=11111010011_2$. Every number from $2004$ to $2047$ starts with $11111$ and has at least one more $1$, so all $44$ of them qualify.
- $N=1199-44=1155$, remainder $155$. The answer is $\boxed{155}$.
Let $N$ be the number of positive integers that are less than or equal to 1500 and whose base-2 representation has more 1's than 0's. Find the remainder when $N$ is divided by 1000.