It’s unfortunately not possible to resolve log download link like this one https://api.travis-ci.org/v3/job/123456789/log.txt by only job number as that link includes job id value.
I’ve reviewed a related issue Using unified cache / Control cache identity and noticed that ids of 112 jobs of this build Travis CI - Test and Deploy with Confidence are sequential.