PRIMES NINJA

Cut what divides. Leave what is prime.

Fruit Ninja with numbers. Numbers fly up out of the dark. Swipe through the ones that divide, and they break into their factors. Never touch a prime. As the story goes on, what counts as prime keeps changing.

Play in your browser Free, nothing to install · made for a phone held upright (a mouse works too) · Japanese voices with English subtitles · sound on Or download the Android app (APK, 49 MB, version 1.6.0)

The trailer, filmed by the game playing itself · under two minutes, with sound

How it plays

  • Swipe to cut. A number that divides splits into its two most even factors, and the halves fly on: 360 becomes 18 and 20, then 3, 6, 4 and 5, until only primes fall. When the last one lands, the factorization is written out: 360 = 2³ · 3² · 5.
  • Never cut a prime. The blade rings off it. That, or letting a number that divides fall uncut, drains the energy bar at the top. Every good cut fills it again, so getting about half of them right is enough to keep going. Streaks build a multiplier (×2, ×4, ×8): the game is about the high score. If the bar ever runs dry you're sent to the white room, where a gentle voice explains, briefly, what you missed.
  • Cut well and the band answers. Every hit lands on the beat of the music: a taiko for one cut, an orchestra stab for three in one stroke, a choir when a big number comes apart.
  • The story is the campaign. The Dojo, on the title screen, lets you play any maths level on its own.

What you cut

Sixteen maths levels. They tell one story: whether a thing breaks into primes in exactly one way, and how "prime" depends on where you stand.

  1. 1First CutPrimes and composites under 30.
  2. 2EvenEvery even number but 2 divides. Look at the last digit.
  3. 3ThreesDigit sums: 51 = 3 × 17, 87 = 3 × 29.
  4. 4Past a HundredTrial division up to √n, and cascades of cuts.
  5. 5Ninety-OneImpostors that look prime: 91, 119, 133, 143, 221.
  6. 6The Root of FiveAdd √5 and five breaks. So do primes ending in 1 or 9: 11 = (4+√5)(4−√5).
  7. 7The Root of Minus OneAdd i: a prime that is a sum of two squares splits (Fermat). 3 + 4i = (2 + i)².
  8. 8Every RootWith every square root, every whole number breaks.
  9. 9No BottomRoots of roots: √2, ⁴√2, ⁸√2… Nothing is whole.
  10. 10PolynomialsBack to the rationals. x² + bx + c splits when b² − 4c is a square; x² + 1 holds.
  11. 11Higher DegreeThe rational root test. x⁴ + 4 splits (Sophie Germain); x⁴ + 1 doesn't.
  12. 12GraphsThe Cartesian product. A cube is an edge times an edge times an edge.
  13. 13Clocksℤ/6 = ℤ/2 × ℤ/3, but ℤ/4 won't split, though 4 does.
  14. 14KnotsConnected sums: a granny knot is two trefoils. The unknot is like 1.
  15. 15The MonsterEverything at once, with a simple group of 8·10⁵³ symmetries drifting through it.
  16. 16Two BladesSide by side, and then a number nobody can cut.

The story

Ken was the fastest boy in his school, and that was all he was good for. One day the clever kids wrote 91 on the blackboard and asked him if it was prime. He said yes. From that day on, he held a sword.

Now he cuts whatever divides and leaves whatever doesn't. He gives his numbers the root of five, then the root of minus one, then every root there is, until nothing is left whole and he has to ask what the cutting was for.

Between the maths levels you play inside his head. Cut the scenes where he shows fear, sorrow, joy or love, and they fall apart into Ken and the feeling. Leave the scenes where he is strong. Then the Pirate Queen of Mathematics arrives. She steals theorems from every field, and she has a voice he knows.

Pictures

The flat of a katana filling the frame as it is drawn upward; reflected in the steel, chalk lines of mathematics slide past
Every launch: the blackboard, in the steel
A blackboard of open problems in chalk handwriting (Gauss's class numbers, Vizing's conjecture, the Jones polynomial, FACTOR ∈ P) and a boy at the board with his head bowed
Open problems on the board
Ken in silhouette holding his sword high across a huge pale moon, under the title 素数忍者
The title
Numbers in ink-brush rings over a night sky; 119 = 7 · 17 and 133 = 7 · 19 written out after cuts
Ninety-One: impostors
Under an aurora: 41 = (3√5+2)(3√5−2) and 29 = (7+2√5)(7−2√5) written out
The Root of Five
Gaussian integers: 3+4i = (2+i)(2+i) and 5 = (2+i)(2−i) written out
The Root of Minus One
Graphs drawn in chalk inside the rings over a moonlit sea: a cube and a prism among them
Graphs: a cube is three edges
Knot diagrams in the rings, with 3₁ # 4₁ written out
Knots
Ken on guard on the shore, facing the Pirate Queen of Mathematics on the bow of a ship with a glowing white sail
The Pirate Queen of Mathematics

Ken's and Yuki's voices are Japanese voices from ElevenLabs' library ("Ryu" and "Chihiro"). The score is epic orchestral rock made with Suno, and the hits are timed to its beat. Everything you see is drawn in code: the ensō brush rings, the ink figures, the katana and the blackboard. No Bottom's endlessly falling tone is synthesized. Your place in the story is saved in your browser.