The **doubling sum** function is defined by:
\[ D(a,n) = a + 2a + 4a + 8a + \ldots \] 
This sum contains \( n \) terms. For example, we have:
\[ D(5,3) = 5 + 10 + 20 = 35 \]
and
\[ D(11,5) = 11 + 22 + 44 + 88 + 176 = 341. \]
Determine the smallest positive integer \( n \) such that for every integer \( i \) between 1 and 6, inclusive, there exists a positive integer \( a_i \) such that \( D(a_i,i) = n. \)

Let's think step by step and output the final answer within \boxed{}.
user