• Entertainment
  • Television

Breaking Down the Thrilling Ending of Prime Target With the Help of the Series Creator

12 minute read

Warning: This post contains spoilers for Prime Target

When Steve Thompson set out to write a thriller around mathematics, he remembered reading “The Code Book” by journalist Simon Singh. The dense text covered various ideas about cryptography, but Thompson (a former mathematics student) was particularly fascinated with a chapter about prime numbers, the crucial integers that make up the foundation of all computer and data coding. The more he read, the more Thompson began to see a doomsday scenario.

“It suddenly occurred to me that if a mathematician was born tomorrow who was able to find a pattern in prime numbers, they would be able to crack every computer code in the world,” Thompson says. 

That scenario became the premise behind his Apple TV+ series Prime Target, which follows Edward (Leo Woodall), a post-graduate mathematician at Cambridge who discovers an international conspiracy to prevent him from determining the prime number formula. Once he teams up with Taylah (Quinetssa Swindell), a defecting NSA agent who wants to protect him, Edward spends the majority of the show investigating mysterious deaths, chasing after ancient artifacts, outrunning government surveillance, and writing out equations that get him one step closer to unlocking global security systems.

In this week’s season finale, “The Key,” Edward is confronted by the worst-case scenario that initially intrigued Thompson. Soon after solving the prime formula, Edward learns that his Cambridge professor James Alderman (Stephen Rea) was actually responsible for developing public key cryptography in the 1970s, and has been searching for decades for a mathematician to crack his impossible lock, which he originally intended for personal security, but now allows governments to “hide their worst crimes.”

Alderman eventually explains to Edward that he was responsible for the Baghdad bombing (the inciting incident of the series), which aided Edward’s pursuits, and is now keen to weaponize the prime formula to spark revolution—disrupt large banks, infiltrate missile systems—and absolve himself. That is, until Edward shoots and kills him on school grounds, ending Alderman’s payback, and flees the scene with Taylah, who has digitized the prime formula on her phone. Before police catch up with them, Edward takes her phone and escapes to an adjacent field, knowing he’s destined to be a precious fugitive forever. 

Ahead of the finale, Thompson spoke with TIME about the complex ending and why he believes that “mathematicians are the most dangerous people on the planet.”

TIME: We finally learn that Professor Alderman is responsible for the Baghdad blast and has been aiming to solve the twin prime conjecture that he created years earlier. Was his creation of public key cryptography based on a real person’s work?

Thompson: Alderman is sort of a conglomeration of five or six mathematicians, two in particular, in the mid-70’s in America, who were working on this idea of public key cryptography. It's a really interesting idea they came up with. Prior to it, if you wanted to code something, you needed a key, you locked it, and then you handed the key to another person, and they unlocked it. But people realized that the key was the really dangerous part, because if you could get hold of the key, you could break it. And that's what happened in World War II [with the] Enigma machine. So public key cryptography came out with this idea that you can make the key public, give it to everybody, but you should have two keys—one to lock it and one to unlock it. You never need to share the key, so you'll never lose it.

Prime_Target_Photo_010807
Stephen Rea in Prime TargetCourtesy of Apple TV+

So, they were smart enough to create this lock, but they always knew there would have to be someone smarter than them to unlock it effectively?

Yeah, they invented this algorithm that’s very easy to find, but it’s very difficult to unlock. That's the point. It’s a brilliant concept and a brilliant piece of mathematics. In the series, Alderman is having this kind of crisis of faith, right? Now he's seeking to destroy it. And this is exactly what happened to some of those guys on that team. They were a bunch of free thinkers. They were a bunch of hippies, actually, who felt that government intrusion and government surveillance was too strong, that people's lives were being invaded. They created public key cryptography to help people hide their secrets from the government. But the complete opposite happened. The government got hold of public key cryptography and used it to hide their own secrets so that all the intelligence files and all the defense files, everything at the Pentagon, is now hidden. At least one of them had a massive crisis of conscience and said they would love to see it destroyed. That's effectively what Alderman is saying.

Alderman is kind of effectively looking to be a cyber terrorist. He talks about creating a revolution in the name of progress. Is there any other way this could be resolved? Or is this math an all-or-nothing proposition?

The trouble is that public cryptography is just ubiquitous. Everybody uses it for everything. We're using it now as we speak. We're using all these computers and to try and extract it, change it, move it, is almost impossible. His argument is we're going to have to use a sledgehammer. There's nothing else we can do because now society has put all its eggs in one basket. This is the way we communicate now. And this is the way we keep our secrets. It is our entire world, which is why he's doing the work of cyberterrorism. If every missile defense system goes down tomorrow and every national bank is bankrupted tomorrow, the world is going to be in chaos. 

In his conversation with Alderman, Edward comes to the realization that solving the equation is going to be his legacy, and that he’ll be considered forever as a “destroyer of worlds.” Is that every mathematician's greatest fear? 

That's brilliantly insightful, because most mathematics is developed in a vacuum. Mathematicians come in two sizes, pure and applied. Applied mathematicians are interested in physics and the real world and how airplanes fly and how buildings are built. But pure mathematicians (like myself) have no interest in the real world at all. All they want to do is play games with numbers and letters on a page just to see what little patterns they can make. You could spend your life writing a thesis on something so abstract that it will never affect anybody or the world, or will have no effect on whether planes run on time or the trains operate.

And then, occasionally, somebody creates a piece of mathematics where we go, “That does have an application.” The last time that happened was Chaos Theory. We've realized it does affect things, like the way diseases spread through the human body or the way organisms grow. It was able to put to some really benevolent use for humanity and helped in the study of medical science. The risk is, of course, you create it in isolation, which is exactly what Edward does.

What do you think motivated Edward to kill Alderman in the end? Was it simply to end the cycle and prevent more mathematicians like him from being killed? 

I think if the series has a deeper message, it’s that ideas are dangerous, that what goes on in your head can be weaponized. And the problem for Edward is that he's created this theorem and once you've seen it and understood it, you're done for. You can't extract it from your brain. That's why Safiya died. That's why Robert [Mallinder] died. Because they saw it and were not able to take it out of their brains. It's impossible. Alderman effectively says, “If it's not you, I'm going to find somebody else now that I know the math is possible.” At that moment, Edward realizes he needs to stop Alderman. He's also in terrible danger because he will always be chased. He'll always be hunted, because it's in his head.

You're saying that Edward would always remember how to write out all those equations on the white board again—even if he lost Taylah’s phone?

That's completely legitimate. In math, we are always trying to simplify, simplify, simplify. If you can say something in half a sentence, don't say it in a full paragraph. It's the opposite of literature where you're always seeking to express yourself in an interesting, soul-searching way. With mathematics, it's 'How economical can we be?' Pythagoras' theorem is famously brief and everybody can understand it. And it's been simplified down to the simplest possible form. It was brilliant what Leo Woodall did. He learned all that math and wrote it on the wall. He's not a mathematician, and to absorb that and regurgitate it and how much he memorized? It was amazing.

Prime_Target_Photo_010805
Quintessa Swindell and Leo Woodall in Prime TargetCourtesy of Apple TV+

So he wrote out everything? 

Isn't it incredible? We've got a whole team of mathematicians there from Royal Holloway University at Egham in London sitting there coaching him and telling him what to write. He stood up day after day and wrote this stuff out. It must have been like cramming for an exam and then forgetting it all the following day, which we've all done. I think if you asked him now what he wrote, he probably wouldn't have a clue. It was incredible to watch him do it because it was really convincing.

I want to shift briefly to Taylah and Jane meeting in the field together. Is it possible that Jane could have shot or tackled Taylah to grab the prime finder and run back to the NSA with it? Would that have solved anything or is it a moot point if Edward can still remember the equation?

You’re right, eventually, it would find its way somewhere and you wouldn't be able to contain it. There's a brilliant speech at the beginning of Chris Nolan's film Inception where somebody says, “An idea is like a virus.” You'll just never be able to put the toothpaste back in the tube. And that's the point we've got to by the end. It's now out there.

How difficult was it for Taylah to really rupture her relationship with Jane, especially since Jane gave her a second chance at life?

That's Taylah’s weakness, her Achilles heel. Her godmother, someone she's incredibly close to, who has rescued her in the past, is her boss and also works for the NSA. And if you're involved in intelligence, any frailty at some point is going to be exploited. Jane's Achilles heel is that she's never going to pull the trigger on Taylah, and that's why Taylah is still living and manages to make it to the end of the show. It’s a real crossroads for her. But there is the sense that what's happening is bigger than both of them. Ultimately, the message is that two people who love each other can't be involved in an intelligence service together. It's going to confuse the issue.

Prime_Target_Photo_010806
Quintessa Swindell in Prime TargetCourtesy of Apple TV+

At this point, will Edward always be a fugitive, or is there a way for him to end the pursuit? 

He's now the world's most dangerous hacker. If this were to happen in reality, the very first thing is that every single government, every single big business would invent an alternative. They would replace public key cryptography with something that their teams had worked on and a whole bunch of other mathematicians would suddenly become incredibly wealthy and incredibly valuable. Because if you invent the bomb, then somebody has to invent something that neutralizes the bomb, to invent the ultimate missile defense system.

Is there something more complex than the twin prime conjecture? 

We can speculate. There's this ghost out there called quantum. They've been talking about quantum computing, which would be able to find prime numbers very quickly and would therefore be able to break all codes. My math tutor at university, who I kept in touch with, was saying quantum almost seems like a myth. We keep talking about it as if it's about to happen, but it could be 20 years off. We don't know. But everybody has always been expecting there might be a moment when primes crash. And we're just demonstrating the moment.

Do you think there is an analogous Baghdad site that has yet to be discovered that would ultimately unlock another theory like this?

That's tantalizing. It's great that you mentioned the Baghdad site because the Arab mathematicians who were based in Bayt al-Hikmah are responsible for so much of the mathematics we now use. That's where algebra was born. Algebra literally means “reunion of the broken,” an Arab phrase. It's almost like Indiana Jones, the idea that there is a secret buried out there in the sand that actually could solve all sorts of problems. Sadly, they believe Bayt al-Hikmah was destroyed when Baghdad was sacked a thousand years ago. So finding it is a bit of a fantasy for me, but a fun fantasy, nevertheless.

I suppose it’s fair to say that writing this whole series was about as cathartic as it gets.

Yeah—for the first time in my career as a writer, I was able to visit the other part of my life and have some real fun with it and indulge in some mathematical fantasies and fiction. It was incredibly cathartic.

More Must-Reads from TIME

Contact us at letters@time.com