If the segments form a geometric progression, then for its sum you can write
L = (0.15 * L) * (q^n-1)/ (q-1) (1 - q^24) / (1 - q) = 6.66666
To find the denominator of GP q, you can solve this equation numerically using a binary search or another method
For the search, we set the search interval (if we know that the segments will decrease - then 0..1) and gradually approach a more or less exact solution (the function is monotonic, therefore any method will converge).
Here is a very simple method of secants (code did not check)

double f(double x) { return (1.0d - exp(24.0d*logf(x)))/(1.0dx) - 6.6666667d; } // a, b - ΠΏΡΠ΅Π΄Π΅Π»Ρ Ρ
ΠΎΡΠ΄Ρ, epsilon β Π½Π΅ΠΎΠ±Ρ
ΠΎΠ΄ΠΈΠΌΠ°Ρ ΠΏΠΎΠ³ΡΠ΅ΡΠ½ΠΎΡΡΡ double findRoot(double a, double b, double epsilon) { while(fabs(b - a) > epsilon) { a = b - (b - a) * f(b) / (f(b) - f(a)); b = a + (a - b) * f(a) / (f(a) - f(b)); } // a, b β (i - 1)-ΠΉ ΠΈ i-ΠΉ ΡΠ»Π΅Π½Ρ return b; } q = findRoot(0.0d, 1.0d, 0.000001d)