Code:

A2: =IF(B1=8+17-A1,A1-1,A1)
B2: =IF(A2<A1,17,IF(C1=8+34-A1-B1,B1-1,B1))
C2: =IF(OR(A2<A1,B2<B1),17,IF(D1=8+51-SUM(A1:C1),C1-1,C1))
D2: =IF(OR(A2<A1,B2<B1,C2<C1),17,IF(E1=8+68-SUM(A1:D1),D1-1,D1))
E2: =IF(OR(A2<A1,B2<B1,C2<C1,D2<D1),17,IF(F1=8+85-SUM(A1:E1),E1-1,E1))
F2: =IF(OR(A2<A1,B2<B1,C2<C1,D2<D1,E2<E1),17,IF(G1=8+102-SUM(A1:F1),F1-1,F1))
G2: =IF(OR(A2<A1,B2<B1,C2<C1,D2<D1,E2<E1,F2<F1),17,IF(H1=8+119-SUM(A1:G1),G1-1,G1))
H2: =IF(I1=17,17,H1-1)
I2: =IF(I1=17,144-SUM(A2:H2),I1+1)

I copied those formulas down 100,000 rows. Then, I found the minimum row number where the value in column A was at no more than 8. That was 24,310.