Number theory and Sieve Magic
40 views Sep 21, 2024
40 views • Sep 21, 2024
In this video we continue to look at two interesting variants to the Eratosthenes sieve yielding prime numbers: last time we introduced the Plus Minus sequence, and today the Minus Plus sequence, which starts 2,4,5,8,13,16,17, ... (not yet in the OEIS!) and consists mostly of odd numbers, this time all congruent to 1 mod 4, along with the even numbers which are powers of two. We'll have a look at some rather obvious congruence conjectures (these are excellent topics to think about), along with some difference table calculations looking at gaps between elements of the Minus Plus sequence. I would like to simultaneously show you a conversation with ChatGPT4.0, showing what a powerful tool this will be: but mostly I am asking it to come up with the some extensive calculations. A warning though: getting it to do exactly what you want, without mistakes, is a surprisingly subtle challenge. Don't be too trusting, and make sure to check it and double check it etc. Nevertheless, it has lovely powers of understanding what we are trying to do, and often suggests valuable ways forward. This is a tool that can help level the playing field somewhat between amateur and professional mathematicians, at least at this early stage. In the last section of the talk I want to illustrate some more traditional technology, namely spreadsheet analysis (I use Excel) to analyse sequences very effectively. I want to flag that ChatGPT is quite happy to output spreadsheets for our usage. Very useful. Many thanks to Wild Egg channel Members, and Patreon subscribers!! ************************ Screenshot PDFs for my videos are available at the website http://wildegg.com. These give you a concise overview of the contents of the lectures for various Playlists: great for review, study and summary. My research papers can be found at my Research Gate page, at https://www.researchgate.net/profile/...My blog is at http://njwildberger.com/, where I will discuss lots of foundational issues, along with other things. Online courses will be developed at openlearning.com. The first one, already underway is Algebraic Calculus One at https://www.openlearning.com/courses/... Please join us for an exciting new approach to one of mathematics' most important subjects! If you would like to support these new initiatives for mathematics education and research, please consider becoming a Patron of this Channel at
/ njwildberger Your support would be much appreciated. Here are the Wild Egg Maths Playlists (some available only to Members!)
• Algebraic Calculus One
• Classical to Quantum (Members only)[
• Algebraic Calculus Two](https://www.youtube.com/playlist?list=PLzdiPTrEWyz5VLVr-0LPPgm4T1mtU_DG-)
• Advice for mathematics exploration (M...
• Solving Polynomial Equations (Members...[
• The Hexagrammum Mysticum (Members only)](https://www.youtube.com/playlist?list=PLzdiPTrEWyz5j1BJdXBw1MFst_nQAqzZ_)
• Algebraic Calculus and dCB curves (Me...
• Dynamics on Graphs (Members only)
• Playlist
• Triangle Geometry
• Explorations with q-series (Members o...
• Six: An elementary course in Pure Mat...
• Maxel Inverses and Orthogonal Polynom...************************************************ Here are the Insights into Mathematics Playlists:
• MathHistory: A course in the History ...
• WildTrig: Intro to Rational Trigonometry
• Math Foundations
• Wild Linear Algebra
• Famous Math Problems
• Box Arithmetic
• Elementary Mathematics (K-6) Explained
• Year9Maths
• Ancient Mathematics
• Wild West Banking
• Sociology and Pure Mathematics
• Sociology and Pure Physics
• Old Babylonian Mathematics
• Probability and Statistics: an introd...
• Boole's Logic and Circuit Analysis
• Universal Hyperbolic Geometry****************
Transcript
0:00
Hello thanks, for joining me we are having a little Adventure in the number Theory Direction
0:05
and today is kind of interesting because I'm going to first of all show you the sister sequence to
0:12
the one I showed you last time the plus minus sequence this is a variant to the prime number
0:18
sequence obtained by looking at a variant of the Civ of ostanes and uh these two new sequences
0:27
that we're playing around with have interest in properties they are a lot like primes in some
0:34
sense and um and just to what extent they are like primes is going to be an interesting question for
0:40
us as we go forward but they seem to have some intrinsic um interest and I'm going to sort of
0:47
expand on that show you some more aspects of these sequences which are interesting now I'm going to
0:53
be working with the minus plus sequence today and I'm delighted to uh be joined by my new friend
1:04
chat GPT 4.0 so while we're still in this happy honeymoon stage with the AIS before they haven't
1:10
taken over our lives completely um we can work with them we can learn from them and uh chat GPT
1:19
is just remarkable in things it can do even though it's a large language model as you'll see it's uh
1:26
no slouch when it comes to doing some mathematics I'm also going to be showing you uh a spreadsheet
1:32
kind of version of something we're going to do some Explorations with that and you'll see some
1:36
some really useful techniques for for dealing with the big sequences okay so uh starting point is I
1:45
opened up chat GPT and I'm sort of carrying on from a prior conversation that I had with
1:53
it about the plus minus sequence so today I ask I would like to go over the minus plus sequence
1:59
do you remember that so I wasn't sure whether it sort of got the previous conversation in
2:06
its memory so it replies yes I remember you're working on the minus plus sequence the sequence
2:12
is generated by a specific algorithm that works similarly to the plus minus sequence but with
2:17
a small variation in how elements are removed from the working set so I I really want to go
2:23
carefully over the interaction between chat GPT and myself I think it's really instructive people
2:30
uh are not appreciative yet that this is an entirely new way of doing research okay and it's
2:37
going to take over uh during this intermediate period while us human beings are still sort of
2:44
active useful members of the research community and 10 years from now we probably will not be or
2:52
not be very much okay it's the machines which will be doing all the interesting work and we'll just
2:57
be going oh wow did did you hear what what such and such machine did last week or 10 minutes ago
3:06
but in this honeymoon happy period uh we can we can learn a lot and and it's um really great for
3:13
amateurs because you now have this resource that you know 5 years ago professional mathematicians
3:20
didn't have so you're able to do things that professional mathematicians weren't able to do
3:25
until very recently so it's um it's it's exciting if a bit scary and maybe a little bit depressing
3:34
at the same time all of these things we have to figure out what exactly we think about this
3:39
entire thing but okay I'm not unreservedly in in favor of AIS for sure but okay I do acknowledge
3:47
the usefulness of chat GPT 4.0 especially with this conversation okay so let's continue
3:53
here's the outline of the minus plus sequence algorithm so I want you to um to appreciate that
4:00
um this is not U just a single conversation this is a result of several conversations that I've had
4:07
and I you know I tried to explain to it what what I wanted to do and that's taken a little
4:13
bit of back and forth uh so there were some false starts Etc and it's really important to
4:21
not trust too quickly to check uh to monitor to to you have double checks to make sure that the
4:29
machine is with with you but it's also notable that the the machine is really interested in
4:36
formulating things clearly you know laying things out and I want you to listen to the language that
4:42
it's using and the just the way it's thinking the way it's presenting information Okay so
4:50
we've already talked about the minus plus sequence it's now just summarizing it for
4:54
us here's the outline of the minus to plus sequence algorithm start with a working set
5:00
WS actually I called it working sequence but okay working sequence working set consisting
5:07
of numbers 2 3 4 up to n and an output sequence OS which starts as an empty set actually sequence
5:15
step one take the first element from WS call it X and append it to the OS put it at the end step
5:23
two remove from WS all elements that follow the sequence pattern X 2x - 1 3x 4x - 1 5x 6 x - 1 7 x
5:35
Etc so let me pause there last time when I talked about the plus minus sequence what we did is we
5:42
we took X and we can remove that one and then the next one we're going to remove is obtained
5:48
from X by adding x + 1 here we're adding x - one to X to get 2x - one so that's the next one we're
5:57
going to eliminate and then after that we we do going to add x + one to that which is bringing up
6:04
us up to 3x okay so in the plus minus situation what we did is we took X we added x + one and
6:10
we added xus one to that sequentially okay so we're essentially uh eliminating X 2x + 1 and
6:18
3X okay so the only difference in this story here is that there's minus signs here at every
6:24
second step instead of plus signs step three repeat step 1 and two until WS is empty and
6:32
step four output the OS when WS is empty you've also generated a portion of the sequence up to
6:39
8,192 which is uh 2 to the 10 11 uh 12 13 I guess the terms up to that point include
6:52
values like so here's the initial part of the minus plus sequence 2 4 5 8 13 16
7:00
17 21 32 37 53 57 Etc if you just saw that sequence you'd be hard pressed to you know
7:09
to understand how this thing carries on very hard pressed in fact it's not in the online
7:15
encyclopedia although it shortly shortly will be maybe one of you can do that um how would you like
7:22
to proceed with the minus plus sequence are you interested in exploring conjectures generating
7:27
more terms or analyzing the pattern further fur Okay and then I reply last time we generated that
7:35
up to 2 the 15 but I wasn't able to download it could you please generate that again okay
7:43
so now it attempts to do that okay and it gives me an output which I check and it's not right so
7:49
I say I think you're not generating it correctly so I ask it to do a more modest thing just up to
7:55
64 it does it up to 64 and that's correct now okay okay um so that looks correct now
8:03
so please try again for two to the 15 be careful with your arithmetic I'm encouraging it and now
8:08
it's saying okay the minus plus sequence up to 25 has been carefully generated you can download
8:13
the corrected sequence using the following link okay and I've done that and I think that's right
8:20
but you know it's definitely worth checking I will uh try to uh put a link to that somewhere
8:28
so it's a just a spreadsheet and I I'll show it to you in in in a little while then I ask can
8:34
you list for us here the elements of this minus plus let's call it MP sequence up to 512 please
8:40
output list in please output in list but form but not in latch form just plain text okay so
8:48
I I just want to be able to see this thing right so I want to scroll through this thing just so you
8:52
can have a look so 2 45 8 13 16 17 21 32 37 53 57 61 64 powers of 2 2 81 93 97 okay and let me just
9:02
scroll slowly through here so you get a sense of um what they look like up to 512 okay so let me
9:14
know if you would like to proceed with further analysis or if there's anything else you'd like
9:18
to explore okay I say great can you verify some congruence conjectures for me one the only even
9:26
numbers which occur in the minus plus sequence are powers of two and all the powers of two up
9:31
to 2 the 15 occur two all the odd entries are one primes meaning that they are congruent to 1 mod 4
9:40
three none of the odd numbers in the MP sequence after five are congruent to 0 or minus one mod
9:47
5 for none of the odd numbers in the MP sequence after 13 are congruent to 0 or minus1 Mod 13 so um
10:01
this is a good thing because it sort of forms another check on whether it's churned out the
10:08
two the sequence up to two of 15 so it it verifies things and and says that okay all
10:14
these conjectures are true true true true true all of your conjectures hold for the
10:18
minus plus sequence up to the 15 okay then I say okay it seems we can have a family
10:24
of similar conjectures as we run through the odd elements of the sequence you see because the five
10:29
and the 13 were actually the uh the sort of the initial odd elements in the sequence the next one
10:38
is 17 and then 21 and then 37 then 53 and then 57 and 61 so I ask it um can you check that if
10:46
we uh if n is such an odd element like maybe 13 or 17 uh then we conjecture that none of the odd
10:56
MP elements after that thing after after it are congruent either to Z or minus one module that
11:03
thing okay so after the 17 appears for what for example I'm saying that no further guy is going to
11:10
be congruent to 0 or minus1 mod 17 so I'm asking it to check this the family of conjectures holds
11:18
for all odd MP elements up to 64 specifically for each odd n up to 64 none of the odd NP elements
11:27
after n are congruent to zero or - one mod n and here are the verified values that it's given me
11:33
okay so now I want to turn to another aspect of things so we know that all the odd MP elements are
11:40
one numbers some of them are prime some aren't can you list all the elements which are prime so here
11:46
on the list of the prime numbers that occur among the odd elements of the minus plus sequence 5 13
11:53
17 37 53 61 97 137 Etc so because we like to count I ask how many such primes are there and there are
12:03
563 such prime numbers amongst the odd elements of the minus plus sequence now I ask how many of the
12:12
odd elements of the MP sequence have exactly two prime factors including multiplicity now I've had
12:18
to explain this to uh chat GPT explicitly because uh previously there was a little bit of confusion
12:26
so I say that by this I mean that for example 12 which which is 2 2 * 3 has three prime factors
12:33
not two so this two is appearing twice so we'll say all together that has three prime factors so
12:39
I'm asking of the um of the odd Elements which have exactly two prime factors uh how many of
12:47
these have both factors being one primes and how many have both factors being three primes because
12:54
we know that all the odd elements of the sequence are are one number numb that is they're congruent
13:00
to one mod 4 so if they're a product of two things the possibilities are 1 * 1 mod 4 or 3 * 3 mod 4
13:12
which is 9 which is also 1 but 1 * 3 is not going to work because that's going to be congruent to 3
13:17
mod 4 so I want to know um you know what what's happening here and it tells me that out of the
13:23
odd elements of the minus plus sequence so 82 we're going up to 2 to 15 have exactly two prime
13:31
factors including multiplicity in this sense and 46 have both prime factors being one primes
13:40
while 756 have both prime factors being three primes now that's a very big discrepancy 46 to
13:52
756 so um can you l list the 46 with two one prime factors together with their factorizations
14:04
so these are the lists of the odd elements in the minus plus sequence that have two prime
14:12
factors both of which are one primes the smallest one is 1,681 so when I was first looking at this
14:22
you know looking at say the first thousand uh up to a, or to 1500 you're not going to find
14:29
any any odd numbers which are products of two one prime factors so actually initially
14:41
I sort of said well maybe that's always the case okay but it's not always the
14:45
case there are some cases where we have two one prime factors but not relatively
14:54
that many of them at least not in this range Okay so so here are the uh the
15:00
values so that's sort of interesting to me um I'd love to know whether that um that carries
15:19
on like I wonder if that sort of imbalance is just sort of a a temporary thing when we're
15:25
relatively small or or if it maintains itself as we go further and further into the MP sequence
15:34
and uh if it does maintain itself there's something to be explained here well even
15:38
even at this stage here we're going up to 36,000 so that's already a pretty big range so why is it
15:44
that the product of three primes a three Prime Times a three prime is like more than 15 times
15:52
as numerous is the product of a One Prime * a One Prime so then I asked how about those
15:59
elements with exactly three prime factors can you list them in their factorizations how many
16:04
have all factors one primes so if the product of three primes is going to be a one a one number
16:10
okay it means the possibilities are 1 * 1 * 1 or 1 * 3 * 3 okay so here's a list of elements from
16:21
the minus plus sequence that have exactly three prime factors along with their factorizations
16:30
unfortunately none of these elements have all prime factors as one primes so we're
16:37
seeing a similar phenomena when we're going to numbers which are products of three primes
16:43
in this case up to this range um none of them have all factors being one primes okay anyway
16:54
here's an Excel spreadsheet which has the list of regular honest good old fashioned
17:03
primes 2 3 5 7 11 13 and it's been given to me by chat GPT and it goes down to let's see
17:14
um down to 16 16,000 and there's uh 1,900 such entries there okay and just beside it I've
17:30
also put the differences so this thing here it's equation it's A3 minus A2 this next one is A4
17:39
minus A3 Etc so these are just the successive differences um in in the number Theory World
17:44
these are called the gaps between the primes and the gaps are very interesting you know there's a
17:49
lot of work trying to understand you know what the S of statistics of these gaps is how how
17:57
big can they get relatively speaking and you know what's the distribution Etc let's just let scroll
18:03
down this so you get some sense of the gaps okay of course this is great for amateurs to ponder
18:12
you will not be the first to have done that right like thousands of people have stared at this over
18:17
and over again I remember being in grade eight or something like this and making a difference table
18:22
for the prime numbers I think probably every aspiring mathematician does this what's the
18:27
pattern let me see if I can figure out a pattern okay anyway um uh so I just want to uh sort of
18:34
alert you know because some of you will have done the algebraic calculus those of you have not done
18:39
the algebraic calculus will of course be aspiring to do that right learn calculus properly um and
18:47
the discrete calculus plays a pretty big role in that and this from a calculus point of view it's
18:53
just the first first differences of this original sequence and it's just you know useful to realize
18:59
that you can just keep going so if I go up here for example and then I say entry let's let's say
19:04
this this one here will be this one minus this one okay okay so it's one now one one one thing I can
19:14
do is I can just uh grab this little thing down here and uh carry on okay and I can go all the way
19:21
down the end I would get all the um the successive differences these are the second differences okay
19:28
of of course it's um you know they're mostly even numbers except for the first one but anyway and
19:35
um if you wanted to go further we just repeat the process but even a more Nifty thing is is just to
19:41
grab the thing and to extend it over in this direction so if we look at the uh this entry
19:47
here this is equal to the difference between C3 which is this one C3 and C2 and this one here is
19:55
the difference between D3 and D2 so one thing we could do is we could grab all of these sorry grab
20:05
that whole row and I'm going to drag the whole thing down and won't just go there okay so I've
20:12
now just at one stroke created uh sort of multiple differences okay um and okay that's pretty cool
20:23
uh the the top row here is especially important if you've taken the algebra calculus that's the
20:28
it gives us essentially the Gregory Newton formula for recovering a polynomail sequence these are
20:33
sort of the crucial coefficients that you use with the Harriet basis elements to recover an
20:38
arbitrary sequence so this is sometimes called the the binomial transform of the original sequence
20:44
you could do this for any sequence of course so this this this sequence that's appearing along
20:48
the top row of the successive differences is a kind of a transform of the original
20:54
sequence and it's of course of independent interest so having said all that let us turn
21:02
to here is um this is pretty small I'll bet can I make that a little bit
21:13
bigger okay so there there we go there's the minus plus sequence okay 2 4 5 8 13 16 and this
21:26
is the spreadsheet that chat GPT is just created for me another great application right so I have
21:34
the spreadsheet here down to presumably uh 3 276 8 which is 2 to 15 so you know for example right
21:43
obviously we're going to be wanting to sort of examine uh differences of this thing so let's
21:49
just actually do this so let's here let's say this is going to be equal to um this entry minus
21:58
the previous entry okay and it's a two and I'm just going to drag this thing I actually go
22:07
right well I don't have to go all the way bottom okay I've got to 20,000 that's probably enough
22:15
okay so let's just uh admire this so this is like the the equivalent in the minus plus world
22:24
of of studying the gaps between primes Okay so you know to try to understand the regularity
22:31
or otherwise of of this sequence you could study these gaps and you know and um try to come up with
22:38
some statistics for them you could reduce them various with mods you could do various things um
22:44
we'll talk a little bit more about about that in our next video and of course if you wanted
22:49
to get uh higher um differences we can just drag this thing over like this okay let's just check
22:59
that this thing here is equal to B3 minus B2 so that's giving us a difference of the B table the
23:04
B column and then we could take the whole thing maybe from here sorry here up to here okay drag
23:11
the whole thing just go down here and we get difference table for the minus plus sequence
23:21
okay and and then along the top row here the 2 2 -1 3 - 3 -1 9 - 16 so that's also got to be
23:30
in the online encyclopedia at some point right so that's the binomial trans form of the minus
23:37
plus sequence but you know there's potentially all kinds of things to stare at here you know stare at
23:43
these things and and see if there's anything interesting see if there's any interesting
23:46
patterns um so there's a lot to do here especially having a lot of fun um for amateur mathematicians
English
AllFor youRecently uploadedWatched