f(k)^2=k^4+2k^3+3k+2+2k+1
f(k^2)=k^4+k^2+1
The ratio of these values forms a nice pattern:
k=1, 3/1
k=2, 7/3
k=3, 13/7
k=4, 21/13
k=5, 31/21
So the product of these is just the last numerator, which we need to be at most 2019. Continuing the table
k=44, 1981/1893 (smaller)
k=45, 2071/1981 (too big)
Without looking too hard into why this works, the solution is n=44

Posted by Jer
on 20190418 11:07:17 