What is the biggest tangent of a prime?

preview_player
Показать описание
What is your Mega-Favourite Number? The playlist of #MegaFavNumbers videos is here:

If you make a video about a number bigger than 1,000,000 use the hashtag #MegaFavNumbers and we'll add it to the playlist!

Here is my current mega-favourite number:
1,169,809,367,327,212,570,704,813,632,106,852,886,389,036,911

This is the OEIS page for A249836: Numbers n for which tan(n) is greater than n.

Thanks very much to Jacob Vecht for emailing me their new interesting integer. Keep an eye out for when all their newly discovered numbers appear on the OEIS.

These are the ones I found:
tan(1) = 1.6
tan(11) = -226
tan(33) = -75.3
tan(52174) = -181570.3
tan(260515) = 383610.7
tan(573204) = -3402633.8
tan(37362253) = 37754853.4
tan(42781604) = -85369290.4
tan(122925461) = 326900723.5

My terrible code is on github.

CORRECTIONS
- None yet: let me know if you spot any mistakes!

Thanks to my Patreons who mean I can spend time wrangling a gaggle of youtubers into all making videos on the same topic. Here is a random subset of those fine Patreon People:

Louie Ruck
Claire Greenhalgh
Neil McGovern
Ron Hochsprung
Alan Flett
Matthew Schuster
Everett Chouinard
Alex Hackman
Sjoerd Wennekes
Samuel Ytterbrink

As always: thanks to Jane Street who support my channel. They're amazing.

Filming and editing by Matt Parker
Music by Howard Carter
Design by Simon Wright and Adam Robinson

MATT PARKER: Stand-up Mathematician
Рекомендации по теме
Комментарии
Автор

These numbers are indeed quite rare! Here is another one :)



Here is how this one was found: consider continued fraction approximations of Pi (3, 22/7, 333, 106, ...) - series of a_n/b_n and look for the approximation where
1. a_n is even and is equal to 2 * p (where p is prime number; this is the number we are looking for);
2. n is even, so that tg(p) is very large positive number (as opposed to very large negative number).

Then p satisfies these properties, reason being is that since a_n/b_n approximates Pi really well*, Pi/2 + Pi*n ~= p where n=(b_n-1)/2.

*something something math

AkimKumok
Автор

this whole video is just going on a tangent

GameCyborgCh
Автор

Everyone should be very careful when taking the tangent of very large numbers. Usually computers do this by subtracting pi many times until in the range of -pi to pi, and then taking tan of the result (relying on periodicity). However, if you're just using pi as a 32 bit float, you may not have enough digits to accurately find tan, after shifting by pi (but not exactly pi) over and over. Your number may land in the wrong spot on the very very steep tan function.

joeymurphy
Автор

3:32 "technically interesting" is the new thing I'll use to annoy all my non-maths friends from now on. This is pure gold.

lucasdomingue
Автор

whoever wrote in like that is very wrong, the tan bit is hilarious

amyshaw
Автор

My girlfriend: "that bit with the tangent line is cringy"

Matt: *reads an email that is flung away by the tangent line*

girlfriend: *can't stop laughing* :)

CGreyEminence
Автор

17 as a favorite small number sparked a memory…

A math I knew once did a standard equation derivation and told the class “now plug in a value for X and see what you get…”

One student asked “which value?” to which the teacher replied…

“Well, zero times anything is zero so that’s out. One times anything doesn’t change so forget that. Two is the only even prime, three is the smallest odd prime, four is two squared. Five is the only prime that ends in 5, six is a perfect number, seven is too lucky. Eight is a perfect cube, nine is a perfect square, any number that ends in zero is out. Eleven is too close to ten, twelve is divisible by too many things, thirteen is unlucky, fourteen is twice as lucky as seven, fifteen, well, any number that ends ends in 5 or 0 is probably too special. Sixteen is a perfect square and its square root is a perfect square. Eighteen is like twelve, it’s just too divisible. By the time you get to nineteen and raise it to a power things just get too big, so seventeen. Plug in seventeen.”

jameswkirk
Автор

There's actually a way to generate those hits efficiently:
1. Get a rational approximation for pi = a/b, where a is even.
2. Your magic number x with tan(x) = large is calculated as: x = a*(k+1/2).
3. Cranking up k will make the approximation worse and worse, so at some point you'll have to find the next rational approximation for pi to generate more numbers.

4. Regarding primality: Since a has to be even, multiplying by (k+1/2) will always result in a composite number for k>0. So for each family of magic numbers, only the very first can be prime. Or in other words: only those apprimations of pi where the numerator is 2*prime will give us primes in this process.

hallfiry
Автор

Okay, this should clearly be "favorite mega-number", not "mega-favorite number". It's the number that's mega, not the favorite-ness.

wbfaulk
Автор

Absolutely love the bit about graphing tan.

tommysimpson
Автор

My first mega-number was a simple one: 10^100 Why? Because that was the largest number that could be displayed by my first scientific calculator, back in 1974 (well, actually but let's not quibble). And I also enjoyed the simple fact that 10^100 had a name: A googol. A name that, two decades later, would be misspelled when naming what has become one of the largest tech companies in the world.

The real question I asked of my calculator was this: What was the simplest non-trivial calculation that could cause the calculator to generate that value? The calculator had an exponentiation function (^), which lent itself to a subsequent question: What value raised to itself would max out my calculator and equal 10^100? That is, for which value x does x^x=10^100?

I needed a place to start: Clearly, x had to be be greater than 10 and less than 100, so I started at 50, which turned out to be a surprisingly good place to start, as the first digit was correct! Finding all the other digits was a long and boring iterative process that required close focus to correctly append a digit to the prior closest value that didn't overflow. And I still remember each digit of that number to this day, 46 years later: 56.96124842

So 56.96124842 is my "favorite mega-generating-number".

flymypg
Автор

Using continued fractions as suggested by Moritz Ernst Jacob one can find a bigger prime p with p<tan(p) within a few minutes using PARI/GP. It has 1017 digits (so forgive me for not posting it in its full glory!) and begins with 230835870782... and ends with ...28610326005069. It comes from the numerator of the 1985th convergent of the continued fraction of pi.
By the way, if we only care about primes where p<|tan(p)| then the first such prime is actually 11 (coming from the famous approximation 22/7 for pi).

michaelh.mertens
Автор

1:30 Idk precisely how Wolfram Alpha does it, but the Miller-Rabin primality test is a commonly used algorithm that can (probably) compute the primality of an integer in Õ(log(n)^4) time. For reference, I coded up a single-threaded implementation of this test in Rust at one point, and for actual bonafide 64-bit primes on my mediocre computer, the time taken to complete the test wasn't even noticeable, so even though this particular number is about twice the digits (and thus 16x the time), considering they probably have much much better computers *and* use parallelism, Wolfram-Alpha should have no problem figuring out its primality .

Also, for those wondering, _technically_ Miller-Rabin is not yet _guaranteed_ to be polynomial in the number of digits as the proof of it depends on the generalized Riemann Hypothesis. However, for sufficiently "small" integers, this doesn't matter as all primes up to a certain point have been proven to work.
Additionally, despite this, primality testing actually _has_ been proven to reside in P and can be solved for sure in Õ(log(n)^6) using the AKS primality test.

haniyasu
Автор

Alright but that bit where the paper flew out of your hand made me laugh so much. It was a good bit

fibbooo
Автор

Big fan of 2³¹-1 personally. Maxed out my score in a game once, can't remember which, and was mystified when it wouldn't go past 2, 147, 483, 647. As an added bonus, it's a Mersenne prime!

hiimemily
Автор

I’m a chemist, therefore my favorite mega number is Avogadro’s number

bsheaves
Автор

That guy really created a sequence for tan(p)>p. Must be a hobby

franciskatende
Автор

I have been well and truly nerd-sniped, and have yet to find another prime with p < tan(p) - Will update if I get one.

Erin-ksjp
Автор

1:40 this number is relatively small for primality testing. They probably use the Adleman–Pomerance–Rumely primality test, which is a deterministic version of the Miller test. Which was the topic of a recent Numberphile video (re witness numbers). Primality testing of general integers only begins to take a significant amount of time once you get close to 1000 digits or more and have to use ECPP test.

bur
Автор

Matt I'm already busy with the land area video!

SpartaSpartan