My implementation diverges at i = 20 due to my interpretation of the sequence. I think it might be a valid interpretation though, I'm not sure, what are your thoughts?
| i | n | d | d2 | d3 |
|----+----+----+----+-----|
| 19 | 24 | 19 | 7 | 260 |
| 20 | 26 | 26 | 8 | 286 |