Source: 2018 Canadian Open Math Challenge Part B Problem 3
-----

The [i]doubling sum[/i] function is defined by
\[D(a,n)=\overbrace{a+2a+4a+8a+...}^{\text{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.$
1. The doubling sum function \( D(a, n) \) is defined as the sum of the first \( n \) terms of a geometric series where the first term is \( a \) and the common ratio is \( 2 \). Therefore, we can express \( D(a, n) \) as:
   \[
   D(a, n) = a + 2a + 4a + \cdots + 2^{n-1}a
   \]

2. The sum of a geometric series \( a + ar + ar^2 + \cdots + ar^{n-1} \) is given by:
   \[
   S = a \frac{r^n - 1}{r - 1}
   \]
   Here, \( a \) is the first term, \( r \) is the common ratio, and \( n \) is the number of terms. For our series, \( a \) is the first term, \( r = 2 \), and there are \( n \) terms. Thus:
   \[
   D(a, n) = a \frac{2^n - 1}{2 - 1} = a (2^n - 1)
   \]

3. We need to find 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 \). This means:
   \[
   n = a_i (2^i - 1)
   \]
   for some positive integer \( a_i \). Therefore, \( n \) must be a multiple of \( 2^i - 1 \) for each \( i \) from 1 to 6.

4. We need to find the least common multiple (LCM) of the numbers \( 2^i - 1 \) for \( i = 1, 2, 3, 4, 5, 6 \):
   \[
   2^1 - 1 = 1
   \]
   \[
   2^2 - 1 = 3
   \]
   \[
   2^3 - 1 = 7
   \]
   \[
   2^4 - 1 = 15
   \]
   \[
   2^5 - 1 = 31
   \]
   \[
   2^6 - 1 = 63
   \]

5. The LCM of these numbers is:
   \[
   \text{lcm}(1, 3, 7, 15, 31, 63)
   \]

6. To find the LCM, we factorize each number:
   \[
   1 = 1
   \]
   \[
   3 = 3
   \]
   \[
   7 = 7
   \]
   \[
   15 = 3 \times 5
   \]
   \[
   31 = 31
   \]
   \[
   63 = 3^2 \times 7
   \]

7. The LCM is the product of the highest powers of all prime factors appearing in these factorizations:
   \[
   \text{lcm}(1, 3, 7, 15, 31, 63) = 3^2 \times 5 \times 7 \times 31
   \]

8. Calculating this product:
   \[
   3^2 = 9
   \]
   \[
   9 \times 5 = 45
   \]
   \[
   45 \times 7 = 315
   \]
   \[
   315 \times 31 = 9765
   \]

Therefore, 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 \) is \( 9765 \).

The final answer is \( \boxed{9765} \)