Like many mathematicians and teachers, I often enjoy thinking about the mathematical properties of dates, not because dates themselves are inherently meaningful numerically, but just because I enjoy thinking about numbers.

A new year means a new number to think about. And one interesting fact about our new year, 2018, is that it is *semiprime.*

A number is *semiprime *if it is the product of exactly two prime factors: for example, 15 = 3 * 5 is semiprime, as is 49 = 7 * 7, but neither 13 nor 30 are. Semiprime numbers are also referred to as *biprime*, *2-almost prime*, or *pq*–*numbers.*

Semiprimes are very interesting in and of themselves, particularly in cryptography, but what caught my attention is that the previous year, 2017, is a prime number. That means we have a semiprime number, 2018, adjacent to a prime number, 2017. How unusual is this?

I played around a bit and ended up writing some simple programs to find and analyze semiprimes. Among the first 500,000 integers, there are roughly 108,000 semiprimes and 41,500 primes. Of the 108,000 semiprimes, only about 2,500 (or 2.3%) are adjacent to a prime number. This seems low to me: there are 83,000 prime-adjacent spots among the first 500,000 integers, representing 18% of the spots semiprimes *could *occupy. But only about 2.3% of the 108,000 semiprimes end up in those spots. That seems unusual.

In thinking about what happens further out along the number line, I couldn’t help but wonder if there are infinitely many prime-semiprime pairs like 2017 and 2018. I certainly don’t know the answer, but I thought I would start the new year boldly, with a conjecture:

**The 2017-18 Conjecture**

*There are infinitely many pairs of consecutive integers one of which is prime and one of which is semiprime.*

I think this problem’s resemblance to the *Twin Prime Conjecture* led me to both imagine this conjecture and also suspect it’s true. As with virtually everything in mathematics, I’m sure someone has thought of this before, and I would love a reference if anyone can provide it.

Thinking ahead, I was excited to notice that next year will also be a semiprime!

But it appears that the *Twin Semiprime **Conjecture *is already an existing open question, which means I have less than a year to come up with a new conjecture for 2019.

Happy New Year! 2018 has already inspired to me to do some number theory, tackle some computing challenges, and think about some new ideas for the classroom. It’s a good mathematical start to the new year, and here’s hoping 2018 only gets better.

**Related Posts**

Nice observations!

Your conjecture is equivalent to the following conjecture: There are infinitely many primes p such that either 2p-1 or 2p+1 is also prime.

(I leave the proof of equivalence to the reader.)

Primes p such that 2p+1 is also prime are called “Sophie Germain primes”, and the question of their infinitude is still open, as you can see on the associated Wikipedia page.

Primes p such that 2p-1 is also prime don’t have a nice name that I’m aware of, but as far as I am aware the question of their infinitude is also open. At least one person on Math Stack Exchange agrees with me: https://math.stackexchange.com/questions/911690/are-there-infinite-many-primes-p-such-that-2p-1-is-also-prime

(I guess I should also say that the following situation is technically conceivable: That someone has shown that there are infinitely many primes p such that 2p-1 or 2p+1 is also prime, without at the same time showing whether the (2p-1)-type, (2p+1)-type, or both sets are infinite. I’m not aware of such a proof.)

Thanks for commenting. I look forward to telling my students about Sophie Germain primes: it’s exciting to connect to a famous mathematician and a little bit of math history through this modest problem!

Primes are odd, so the semi-prime element of a 2017-2018 pair must be even and thus of the form 2*p.

Thus it is not surprising that the discrepancy between 2.3% and 18% arises. Semi-primes of the form 3p, 5p, 7p, 11p, … have exactly zero percent chance of being part of a 2017-2018 pair.

I’ll bet if you count the number of semi-primes of the form 2p you’ll find that the number of 2017-2017 pairs below 500,000 is very close to 18% of *that* number.

Even more interesting than the 2017-2018 numbers are the 2017-2018-2019.

This sequence is of the form 1p, 2q, 3r where each of p, q, r is prime.

So this brings you a few questions:

* Is this the smallest possible 1-2-3 triplet (aside from 1,2,3 of course!) (We can argue later about whether or not p, q, and r can equal ¹ . . . )

* We know that all 2017-2018 pairs must be of the form 1p,2q or 2p,1q. So must all semi-primes triplets be of the form 1p,2q,3r or 3p,2q,1r? Or are forms such as 1p,2q,5r or 1p,2q,7r possible? I would conjecture that triplets of the form 1p,2q,Xr exist for *every* odd prime X.

* Furthermore, I would conjecture that there is not just one triplet but an infinite number of them for every X.

* And finally, since I seen to be in a conjecturing mood today, I would conjecture that both of the above conjectures are true iff the twin prime conjecture is true. They all have to do with the idea that the prime distribution is smooth in some sense, and if the twin prime connector is true it will show the distribution to be pretty much as smooth as possible given the definition of prime.

Apologies for the typos in the previous comment. I was typing on my phone and a bit distracted.

Using the spreadsheet I created (link below) that lists every 1p, 2p, and 3p prime & semi-prime up through 611,953, I thought it would be interesting to see how many 1-2-3 prime/semi-prime triplets exist in that range.

It turns out that 2016-2017-2018 is the TENTH 1-2-3 triplet, if you start counting with 1-2-3 as the first.

There are 381 1-2-3 triplets through 611,953 (representing the first 50,000 primes).

Here are the first 11 1-2-3 triplets in order:

#1. 1-2-3

#2. 13-14-15 (1X13 – 2X7 – 3X5)

#3. 37-38-39

#4. 157-158-159

#5. 541-542-543

#6. 877-878-879

#7. 1201-1202-1203

#8. 1381-1382-1383

#9. 1621-1622-1623

#10. 2017-2018-2019

#11. 2557-2558-2559

So it has been almost 400 years since we experienced our last 1-2-3 triplet set of years, and it will be another 550 years before we have another one.

Mathematician Colm Mulcahy shared a fun letter to the editor in the

Telegraphthat mentioned this. And Joel Hamkins followed up with some analysis on Twitter.I found a list of the first 50,000 primes (through 611953) here: https://www2.cs.arizona.edu/icon/oddsends/primes.htm

I put them into Excel and did a little analysis on them. Here is what I found:

2885 2p semi-primes were one greater than a prime

2897 2p semi-primes were one smaller than a prime

Total 5781 2p semi-primes adjacent to a prime. (There is exactly ONE semi-prime that is both one greater and one smaller than a prime–4 is 2×2 and adjacent to both 3 and 5. So our total is 2885+2897-1=5781.)

With 50000 primes, there are approx. 100,000 possible spots for a semi-prime to possibly inhabit (one before and one after each prime). But there are 5424 sets of twin primes below 611953, so the total number of spots available is 100,000-5424 = 94,576.

So we have 5781 of 94.576 spots, or 6.11% of possible spots, inhabited by a 2p semi-prime.

The first 50,000 primes stretch from 1 through 611953, but 50,000 of those spots are taken by the primes themselves. So that leaves 561953 spots remaining where a 2p semi-prime could be.

I counted 26,488 2p semi-primes below 611953. So 26,488 of 561,953 gives 4.71% of available spots are filled by 2p semi-primes.

So the interesting thing is that 2p semi-primes fill just 4.71% of ALL available spots, but 6.11% of spots adjacent to primes.

So 2p semi-primes are actually ***MORE likely by a pretty subsantial amount (6.11% vs 4.71%) to be located adjacent to a prime than random chance would suggest***.

FYI I posted the data & calculations summarized above to a Google Spreadsheet here: https: //docs.google.com/spreadsheets/d/1Ygmw43VmxqHe9mftuf-TRsY62caNM205HjWpCckRsQM/edit?usp=sharing

And as to the question: WHY are 2p semi-primes somewhat more likely to be located adjacent to a prime than random chance would suggest?

My guess is because neither primes nor 2p semi-primes are randomly and equally distributed across the integers. Rather, both are relatively more common among smaller integers and less common the higher we go.

What that means is that both the set of primes and the set of 2p semi-primes are bunched up closer to the 0 end of the number line. Since they are both bunched up in more or less the same area that makes them more likely to collide with each other than if they were both randomly and equally scattered across the entire number line.

You’ll note there is a discrepancy between our counts of semi-primes adjacent to primes. You found 2,500 semi-primes adjacent to primes in the first 500,000 integers. I found 5781 semi-primes adjacent to primes in the first 611953 integers.

I think the discrepancy is probably that your software was only counting half the semi-primes adjacent to primes. It was (likely) counting just the ones right before OR just the ones right after a prime, and missing the other possibility.

I count 2450 semi-primes just after a prime, and 2468 just before a prime, through 500,000. So that is in very close agreement with what you found.

It is interesting that the proportion of semi-primes just before & just after primes is very close to 50/50.

And this brings up the question–are the any primes with a 2p semi-prime just before AND just after the prime? I’m guessing yes . . .

I’ll just throw one more possibly interesting question out there related to the above discussion: What is the longest contiguous stretch of prime & semi-prime numbers?

For example, from the above discussion we know there are a number of prime/semi-prime triplets, like 13-14-15 and 2017-2018-2019.

And there is an even longer example contiguous stretch of primes & semi-primes in the very low integers: 2-3-4-5-6-7. So that is a sextuplet. Are there any more sextuplets, or any longer sequences (septuplets, octoplets, etc)? Are there any quadruplets or quintuplets to go along with the (known-to-be numerous) triplets and (one known) sextuplet?

Brent-

Thanks for all the comments! I’m working through some associated ideas this week in class, with the goal of having students come up with and explore their own conjectures. What you’ve provided here–analysis, conjecture, and process–is a great resource for us as we explore!

And thanks for alerting me to the potential error in undercounting the prime-semiprime pairs (I swear I thought I addressed the before- and after- possibilities!). I’ll re-run my analysis and update the post accordingly.

Thanks again!

Here is another puzzle: There are 5424 sets of twin primes below 611953. There are 26,488 2p semi-primes below 611953, filling 4.71% of available spots.

So we would naturally expect there to be about 4.17% X 5424 (approx 255) 2p semi-primes nestled in between those twin primes.

Instead there is EXACTLY one!

And that one 2p semi-prime between two twin primes is the number 4, which is the very first composite number. Above 4–nothing.

It makes you wonder whether #1. I made some horrible mistake in tallying the 2p semi-prime positions or #2. There is some property of the number in between twin primes that somehow prevents it from being a 2p semi-prime.