First of all let's be clear, this is a question that involves compounding, so the answer also involves compounding. If the OP didn't want compounding he would have said "If I invest $360,000 and get $1,360,000 what's the gain?" But that wasn't the question.
The Short Answer
An estimate of return can be made at 6.32 % per annum, but since compounding at a variety of different annual interest rates can still result in a $1m profit there is no exact answer without more information.
The Long Answer
Assuming annual compounding at a constant interest rate, the calculation can be made by this summation:-
$1,360,000 = Σ 10,000 (1 + r)^k for
k = 1 to 36
The closed form (found by induction) is the well-known formula for an annuity due:-
$1,360,000 = (1 + r) $10,000 ((1 + r)^36 - 1)/r
r = 0.0632169, so an annual rate of 6.32169 %
Plot of Investment Accruals with Compounding at 6.32169 % per annum
Compounding the annual gains for 36 years gives an overall gain of
(1 + r)^36 - 1 = 8.08631 or 808.6 %
This is all on the basis that the annual interest rate is constant, or estimated as constant. Variable rates are more likely in real life, and we'll see how that affects the overall gain by using the true time-weighted return.
First though, we'll calculate an estimate of the time-weighted return using the periodic investment values computed from the estimated annual interest rate plus annual deposits:-
1 + return = (10632.2/(0 + 10000)*
(21936.5/(10632.2 + 10000)* ... *(1360000/(1269136.76 + 10000)) = 9.08631
∴ return = 9.08631 - 1 = 808.63 %
As we can see, the result matches the simple compounding calculation.
Now we can try a variable set of annual rates more typical of real life, with the proviso that the investment still results in a final value of $1,360,000. Starting from year 1 to year 36 these are some interest rates that would do that :-
7%, 4%, 6%, 5%, 4%, 4%, 7%, 7%, 7%, 4%, 4%, 4%, 6%,
8%, 7%, 4%, 6%, 6%, 5%, 8%, 6%, 8%, 7%, 7%, 4%, 7%,
5%, 8%, 6%, 7%, 8%, 7%, 4%, 6%, 8%, 9.1074535%
For example, some of the values
1 + return = (10700/(0 + 10000)*
(21528/(10700 + 10000)* ... *(1360000/(1236477.63 + 10000)) = 8.43808
∴ return = 8.43808 - 1 = 743.808 %
Again the final value is $1,360,000 but the time-weighted return is now 743.808 %.
This can be annualised by finding the geometric mean:-
(1 + 7.43808)^(1/36) - 1 = 6.10332 % per annum
So, in this case, slightly lower than the 6.32169 % estimated constant annual rate.
As we see, the overall gain actually depends on the interest rates over the individual years. Their order matters too, because if all the higher interest rates come at the end when the investment is large they have more impact.
Plot of Investment Accruals with Compounding at Varying Rates
With varying rates the investment accrual to $1,360,000 is more uneven.
In conclusion, in the absence of actual annual interest rates, the overall performance of the investment can be stated as gaining at an estimated annual rate of 6.32169 % for 36 years.
A Note on the True Time-Weighted Return
Quoting from - How to Calculate your Portfolio's Rate of Return, page 11
"Lastly, we arrive at the Holy Grail of portfolio performance measurement; the true time-weighted rate of return (TWR). Although this is arguably the most accurate portfolio return in most situations, it requires daily [or monthly/regular] portfolio valuations whenever an external cash flow (i.e. a contribution or withdrawal) occurs."