A subway train operator reports an accident when he hit a kid who was pushed onto the tracks.
At Rikers, the FBI takes DNA samples from Reese and the three other men that they captured. Donnelly and Carter watch and Donnelly assures Warden Hutchens that one of the men is the most dangerous criminal he's ever pursued. He plans to hold them for 72 hours without charges. Once the warden leaves, Donnelly assures her that they have enough fingerprints and DNA evidence, some provided by Carter, to pick out the man in the suit.
Later, Reese is taken to a cell. Once he's alone, he hears a cell phone ring from beneath the bunk. It's Finch, who has planted it there and assures his friend that he'll get them out. He has preparations for just such a contingency and promises Reese that he'll be out in 72 hours. When Reese wonders what happens if they get another Number, Finch tells him that they already have one and that he'll deal with it. Once he hangs up, he goes to a high school classroom where he's working as a substitute teacher. Finch tells the students that their teacher Mrs. Bentham received an all-expense trip to Maui. When one of the students tells him that they're doing busywork as punishment, Finch insists that math isn't a punishment. He challenges one of the students, Caleb Phipps, to try and come up with a formula to make it easy. Caleb admits that he isn't interested, and before Finch can start, the bell rings. As the students leave, Caleb tosses a piece of paper in the garbage.
Finch calls Fusco after forwarding him the student lists, and asks for everything he has on Caleb. The detective reports a couple of run-ins with the NYPD but nothing major. Finch admits that Caleb's grades are average, but examines the discarded piece of paper with the proper formula on it. Fusco says that Caleb had an older brother, Ryan, who died in a subway accident two years ago while drunk. Caleb now lives alone with his mother, an administrative assistant. Meanwhile, Finch follows Caleb and sees a girl, Julia, ask if he's going to a party. Caleb says that he isn't going and is heading out of town. Finch tries to clone Caleb's phone without success, and notices drug trades in the halls. As Finch sends him photos of the two dealers, Fusco warns him to be careful and starts pulling records.
Outside, Finch finds Carter waiting for him. He assures her that he doesn't want her to get involved, but Carter says that she's already involved. She's erased Reese's fingerprint records and tells Finch that the FBI is keeping the DNA samples at a lab in New York. Carter tells Finch that she'll handle it but she needs a couple of thing from him.
Later that afternoon, Finch meets with Principal Lawton. She complains that he tried to get the student to get around Bentham's punishment and tells him to make sure the students do the work Bentham prepared. Once she leaves, a computer science teacher, Chris Beckner, tells Finch not to let Lawton get to him. He advises Finch to run wild and once he leaves, Finch breaks into Lawton's office. As he hacks her computer, Fusco calls to tell him that Caleb was the only witness to Ryan's death. However, the transit cop rescinded the call to Dispatch for backup. While Fusco promises to check out Caleb's home life, Finch checks Caleb's test score records and discovers that he deliberately answered only 50% of the questions correctly. Fusco wonders why he'd want to hide the fact that he's a genius.
The next day, Finch calls Caleb over and asks him about the formula he wrote out. Caleb puts him off and sits down, and Finch writes out the value of pi. When one student asks what good knowing it will do, he talks about how pi contains every number in existence, and every word that exists in every possible combination. Finch concludes by saying that what they do with those possibilities are up to them.
Fusco goes to see Caleb's mother Lori, claiming to be investigating a string of robberies. As Fusco plants a webcam, Lori apologizes because she's running late and clearly has the shakes. As he leaves, Fusco spots a photo of Lori with Caleb and Ryan. The detective calls Finch with what he saw as well as the names of the two dealers, Diego Velasquez and Ronnie Samms. They're working for an up-and-comer that Narcotics hasn't been able to identify.
Caleb goes down the stairs past Diego and Ronnie, who are dealing E to a freshman. They tell him not to say anything, but Caleb turns around and tells them to deal in the locker room because the kid will panic. The two dealers start to shove Caleb around but Finch intervenes and they quickly leave. Caleb angrily tells Finch that he doesn't need his help and walks away. Finch notices that he's dropped a piece of paper covered in computer code.
Beckner is giving a lecture about hacking to his class, including Caleb. Finch hacks the webcam in the room and listens as Caleb defends hackers. Beckner talks about a hacker who got into the Internet and opened up the Internet to the world without ever getting caught. Fusco calls Finch, who informs the detective that Caleb has been coding a program in longhand at home and then taking it to school to enter into the computer. Finch admits that Caleb's work could be groundbreaking, and tells Fusco to find out more about Ronnie and Diego.
That night, Fusco follows the two dealers as they meet with their supplier. Meanwhile, Finch watches Lori at home. Carter calls and tells him that she got his package but will need the right specs. Finch sends them to her and she goes to a club in a dress. A man offers to buy her a drink but she spots the man she's looking for across the bar.
Caleb comes home and makes sure that his drunken mother is covered over for the night. He then leaves and Finch, parked outside, warns Fusco that the student is on the move. Finch then follows him into the night.
Once she's asked a number of questions, Carter picks up the man and they get into his car. As he passes out from the drug she gave him, Carter takes a DNA sample from him.
Fusco calls to tell Finch that he's been following the payoff money halfway across town to a PO Box in Crown Heights. As they talk, Finch spots Fusco and they realize that Caleb is the drug lord they've been looking for.
The next day, Beckner hands out papers and admits that he expected better from Caleb. Finch, monitoring Caleb's computer, sees him receive an e-from his supplier setting up a 2 p.m. meeting. Once class ends, Finch watches as Beckner logs into Caleb's account and downloads a file. Finch then goes outside and finds Caleb, and gives him back the paper he dropped. Finch compliments Caleb on his coding and gives him a suggestion, and the student is surprised that he's right.
Once Caleb leaves, Finch goes outside and meets up with Fusco, and they tail Caleb. He goes to an alleyway to meet with his supplier, Roman, and finds him lying on the ground. Three thugs emerge and dump the drugs out, and their leader, Lorenzo, asks Caleb why he's dealing in his neighborhood. Fusco and Finch see what's happening and Finch gets out of the car. Meanwhile, Lorenzo tells Caleb that he can leave town if he pays back everything he made from his customers by 8 p.m. the next night. Fusco and Finch prepare to move in but Lorenzo decides to let Caleb off with a warning.
That night, Fusco and Finch watch outside of Caleb's home. Fusco wonders why Caleb is picking a fight with a drug dealer, and Finch considers it a waste. The detective has the transcripts from the night of Ryan's death. They show that Caleb initially reported that Ryan was in a fight with two kids, but then retracted his story and claimed it was an accident. Fusco figures that the two kids were Diego and Ronnie, and Caleb is manipulating them into running drugs for him without their knowing it. Meanwhile, Finch confirms that Beckner is still hacking into Caleb's computer. The teacher calls a man, Howard Glazer, and says that he'll be impressed with what he has. Upon hearing that, Finch tells Fusco to keep an eye on Caleb while he follows Beckner.
Later, Finch follows Beckner to a restaurant where he meets with Howard and listens in as the teacher shows him Caleb's programming. It's a compression algorithm and Beckner claims that it's his. He wants Howard to have his firm invest in it, but Howard doesn't believe he has the talent to write that kind of algorithm. Beckner bluffs it out and assures Howard that no one else knows about it, and Howard assures him that he can get the money.
The next day, Fusco calls to tell Finch that he's going to meet with Murphy, the transit cop. Finch discovers that Caleb is moving around money to set up a trust fund with all of his funds. Beckner texts Caleb to meet with him at 8 that night, the same time that Lorenzo wanted Caleb to deliver the money. Fusco suggests that they let Caleb fend for himself and concentrate on getting Reese out of prison, but Finch assures him that he has someone on it.
That night, Carter beaks into the FBI lab and switches out Reese's DNA.
Caleb comes home and Finch watches on the webcam as Lori tells her son that she'll be better the next day. He assures her that it will be while Finch calls Fusco and says that he'll need his help since they don't know which appointment Caleb will keep. Fusco says that he'll be there and then talks with Murphy. He accuses him of not telling the whole story and Murphy explains that Caleb lied when he said there were two other kids. Caleb and Ryan were drinking and dared each other to cross the tracks. Ryan lost and Murphy admits that he don't know which boy got the better deal. He told Caleb that he'd write it off as an accident and admits to Fusco that some things can't be fixed.
After Murphy leaves, Finch calls and Fusco tells him what happened. Finch admits that he lost Caleb when he got on a city bus and all they can do is stake out Beckner and Lorenzo. Fusco goes to the alleyway where Lorenzo met Caleb earlier. When Caleb doesn't show, Lorenzo tells his men to find him. Fusco calls and tells Finch to find Caleb while he deals with Lorenzo. Finch confirms that Caleb isn't at the school and runs into Beckner. When Finch confronts him about what he's doing, Beckner explains that Caleb approached him about his work and asked for some money up front from Beckner to make a trip. The student didn't want any credit but Beckner has set up the whole deal giving Caleb full credit. He claimed it was his own idea to Howard to raise capital, but is giving all of the money from the algorithm, 17-6-21, to Lori's trust fund. Caleb said that 17-6-21 was a dedication, and Finch realizes what it means... and that Caleb won't live to see the money.
Caleb sits in the subway station looking at a photo of his family. Finch sits down next to him and starts talking about making mistakes. Caleb isn't interested but Finch says that their mistakes are part of who they are and there's no moving beyond them. He's realized that 17 years, 6 months, and 21 days is how old Ryan was when he died... and how old Caleb is now when he's chosen to end his life. Finch suggests that they are both connected because they're reckless people. Caleb figures that he'll just keep breaking things over and over and that he should save people the grief. Finch insists that the world is better off with both of them in it, and tells Caleb that he knows that leaving doesn't make it easier on anyone.
Fusco enters the station as the subway train comes down the tracks. Caleb looks at the train as it goes by... and stays in his seat. Finch puts a hand on the boy's shoulder.
Later, Donnelly receives a report that the DNA they have doesn't match any of the four men they captured. He figures that someone got to the DNA samples and orders them sent out for further examination. Donnelly also tells his aide to get him Carter.
Caleb is coming to school and finds Finch waiting for him. He thanks Finch for his help, and Finch talks about how a kid with a homemade computer turned the Internet inside out during the Cold War. He advises Caleb to keep his code close and choose his friends wisely, and gives him a printout with pi to a value of 3,000. Finch tells the student that his number is in there somewhere and Caleb will figure it out eventually. As Finch walks away, Caleb asks how he knew that the hacker had a homemade computer and Finch says that he must have heard it somewhere.
The warden releases Reese but Donnelly shows up and says that all four of his captives have been classified as unlawful combatants. Reese is returned to his cell while Donnelly turns to Carter and says that there are moles in the FBI and she's the only person he can trust. The FBI agent wants her to interrogate all four men... starting with Reese.