Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi Matt,
I created some code which searches for integers with |tan(n)| large in a different way. Instead of searching one-by-one through the integers, this code creates the convergents for the continued-fraction expansion of pi/2. By Dirchlet's approximation theorem, each convergent p/q satisfies the inequality |pi/2 - p/q| < 1/q^2. Multiplying both sides by q it's clear that for each convergent, |q*pi/2 - p| < 1/q. This means that for every convergent with q odd, our numerator p approaches our desired numbers of the form pi + pi/2*n with increasing accuracy. Since |tan(k)| strictly increases as k approaches numbers of the form pi + pi/2*n, this search yields a sequence of integers k_n for which |tan(k_n)| strictly increases. It just so happens that primality is relevant here! The numerator and denominator of the convergents of the continued fraction must be coprime, which means that good candidates for large primes p with |tan(p)|>p are the numerators that the program outputs for which the denominator had many prime factors!