Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding convergents based search #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

been-jamming
Copy link

@been-jamming been-jamming commented Aug 23, 2020

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant