Bacteria can now do complex math
A new experiment pushes biocomputers closer to reality. For some applications, they may be better than silicon
Perri Thaler • February 17, 2025

Biocomputers can be made from anything biological. Bacteria, like the E. coli pictured here at 10,000 times magnification, are a promising option. [Credit: Eric Erbe and Christopher Pooley | Public Domain]
E. coli’s reputation could not be worse. When the bacterium isn’t tainting Quarter Pounders or infesting burritos, it’s closing beaches and contaminating drinking water.
But now, at last, there is something positive to say about Escherichia coli: it can solve complex math problems, and in doing so, aid in the development of new technology. A team of biologists from India reported that they have genetically engineered E. coli to identify prime numbers, determine if a letter is a vowel and learn the geometry of slicing a pizza.
They did so as part of a worldwide academic endeavor to create a biocomputer, a system that relies on biological elements for computational power instead of, for example, a chip made from silicon. The definition of a biocomputer is broad — it includes any computer that relies on bacteria, DNA, RNA, neurons, proteins or any other of a long list of biological materials. Any device that uses organic parts of a living thing to compute answers to given questions counts as a biocomputer, but some of the most promising approaches are built around living cells.
“Cells are like computers,” explains Sangram Bagh, a biophysicist at the Saha Institute of Nuclear Physics who led the new research. “When you think about a bacterium or any other cell, they compute for their survival. They compute for their evolution. They are evolutionally tuned to do that.” He and others studying cell-based computers hope to “hack the cell” to take advantage of the computing power already available, but adjust it to complete specific tasks.
Using living cells as a foundation for computation has many benefits. For one, cells are small. E. coli, for example, is 100 times smaller than the width of human hair. “At this moment, there is nothing [else] at the micron level that can make decisions … you cannot bring a real silicon-based computer to that level,” Bagh says. He explains that both circuitry and batteries face severe challenges at that small size. Bacteria, though, don’t need circuitry or batteries. Their “circuits” are hard-wired into their cellular structure, and they get energy from food.
Cell-based computers could also provide major energy savings. The Blue Brain Project, an initiative at the École Polytechnique Fédérale de Lausanne to create a digital version of a mouse brain, is a good example of how a cell-based computer could be beneficial. The Swiss project used about one megawatt of power to simulate a brain. A real mouse brain uses only 0.1 watts — that’s ten million times less power than the simulation, even though the real brain and the fake brain are doing the same computations. “If you’re able to build a computer with … cells, then your energy requirement is also much less,” Bagh says.
As promising as these advantages sound, there are still some major hurdles to clear before biocomputers become available. The biggest is the lack of good modeling, according to Matthias Függer, who studies cellular computing at Université Paris-Saclay in France.
“Engineering these things is really time-consuming,” Függer says. “You do a huge experiment, and then it turns out to be wrong, and you have to go back and engineer it again.” Without decent modeling capabilities, which the computer chip industry relies on, every experiment must be carried out rather than simulated, he says. That takes time and money. “There are some papers and some approaches to start to simulate things, but they are completely far away from what is available to the chip industry,” he says.
That is why Bagh’s recent research is so notable. “I wasn’t that surprised by the concept of the whole thing. What surprised me was the size of the implementation,” says Ángel Goñi-Moreno, who leads the biocomputation lab at the National Center for Biotechnology in Spain. He’s referring to the number of bacterial populations the Indian team used — 14 — and the number of questions they could answer — 12. “The experimental setup is quite remarkable,” he says, “and working with bacteria populations is quite tricky.”
If biocomputers ever do become commercially viable, they could be used in very different ways than we are used to. While you couldn’t use a bacteria-based biocomputer to run Facebook or WhatsApp, Bagh says, you could use it in ways “that are impossible with traditional computers.”
Medical applications are particularly promising, Függer says, since cells are already “very tightly interacting with living beings.” Building computers from materials known to be symbiotic to people would greatly decrease the risk of introducing computers to the human body. One potential medical application, Bagh says, is the use of cell-based computers to autonomously find and combat pathogens inside the body.
There are potential environmental applications, too. “You cannot get a silicon-based computer and put it into the soil of an ecosystem and program that computer to get signals of the ecosystem and try to restore the balance to a collapsing ecosystem,” Goñi-Moreno says. “That’s a problem that silicon-based computers cannot do anything about.” Bagh described a situation in which a chemical plant may want to use cell-based computers to monitor toxic chemicals in the surrounding environment and adjust their levels by degrading those that are too abundant.
In its latest biocomputing effort, Bagh’s group, which previously taught bacteria how to solve mini-mazes, engineered E. coli in 14 different ways. Each type of engineered bacterium could complete a unique type of computation, so in different mixtures, the E. coli could solve different questions. The biologists stirred the bacteria together in specific combinations, depending on the math question they wanted answered. To ask about prime numbers, for example, they used six specific bacteria variants that they knew had to be blended for this kind of question.
The scientists then fed in math questions by exposing the E. coli to certain chemicals, emulating binary code. Exposure to a chemical served as a one in a specific position in a number, and lack of exposure to that chemical served as a zero in that position. With this faux binary, the team could ask the bacteria to solve predetermined math problems about prime numbers, vowels and geometry.
The E. coli were genetically engineered to analyze these questions by sensing the chemicals. The bacteria could be made to interpret prime numbers, for example, because they received messaging in their equivalent of binary language through chemical exposure. And after being mixed in test tubes, each bacterium acted like an individual neuron, altogether making up a sort of brain — similar to an artificial neural network used in machine learning — able to solve the math problems. The network of E. coli would then respond using fluorescent protein. It would glow green if the answer was yes and crimson if the answer was no.

Fluorescent protein glowing green and crimson — corresponding to yes and no — in response to math questions. [Credit: Sangram Bagh]
The fact that bacteria can solve these questions is not surprising to Függer or Goñi-Moreno. Both are excited, but not shocked, by the results. “It’s along the road that the scientific community has taken,” says Függer. “It’s not a paradigm shift or a game changer or a new technique that enables completely new concepts now.” Instead, it is the natural next step in the path laid out by the field.
That doesn’t preclude this paper from having a significant impact, though. This group is “making a jump in trying to increase the power” of biocomputers by expanding the scale on which this type of research is carried out, explains Goñi-Moreno. “It’s a big step forward in the engineering part, in making things work,” adds Függer.
Bagh’s group doesn’t plan to stop here. They hope to answer a much more challenging question: can bacteria learn new math concepts by themselves, completely autonomously? For now, they require human guidance via question prompts and specific combinations of engineered populations, but that may not always be the case. Goñi-Moreno agrees that this is the right route to take next. “If [bacteria] can learn something new, that will be great,” he says.
The research team in India has one long-term goal, and it is to make sci-fi a reality. “We like science fiction more than science,” Bagh says. “Our goal is always, if there is a fictional thing, can we make it a reality through science?” Bacteria that can teach itself math seems to fit the bill.