The generalised harmonic number of order \$m\$ of \$n\$ is
$$H_{n,m} = \sum^n_{k=1} \frac 1 {k^m}$$
In this challenge, we'll be considering the generalised harmonic numbers of order \$2\$:
$$H_{n,2} = \sum^n_{k=1} \frac 1 {k^2}$$
This sequence begins \$1, \frac 5 4, \frac {49} {36}, \frac {205} {144}, \dots\$ and converges to \$\frac {\pi^2} 6\$ as \$n \to \infty\$.
However, we will only be considering the numerators of this sequence, which forms another sequence known as the Wolstenholme numbers (A007406):
1, 5, 49, 205, 5269, 5369, 266681, 1077749, 9778141, ...
You are to take a positive integer \$x\$ as input. \$x\$ is guaranteed to be a Wolstenholme number. You should output the next term in the sequence of Wolstenholme numbers, i.e. given the numerator of \$H_{n,2}\$, output the numerator of \$H_{n+1,2}\$
You may input and output in any convenient format. Your program should not fail due to floating point errors, meaning that attempts that calculate via the generalised harmonic numbers will be invalid if not using rational numbers. Your program should work theoretically for any valid input, but it is acceptable to fail for inputs that may be outside your language's integer maximum.
You may assume that no element is repeated in the sequence. If it turns out that there are any duplicate values in the Wolstenholme numbers sequence, any and all behaviour is acceptable when passed such values as input.
This is code-golf, so the shortest code in bytes wins
Test cases
x -> out
1 -> 5
5 -> 49
49 -> 205
205 -> 5269
5269 -> 5369
5369 -> 266681
266681 -> 1077749
1077749 -> 9778141
9778141 -> 1968329
1968329 -> 239437889
239437889 -> 240505109
9778141 -> 1968329
testcase correct? From my understanding of the problem, the input should always be smaller than the output (?) \$\endgroup\$