Stargate Address Math Dialer

Click glyphs on the dial pad to build an address, then hit Dial to watch the gate lock each chevron. The math panel shows how many ordered addresses the 39-symbol pool can produce.

Loading interactive simulation...

Lesson

The theory — Stargate Address Math Dialer

A gate address is an ordered selection without repetition — a permutation. Order matters (the same symbols dialled in a different sequence are a different address) and no symbol repeats, which is exactly the case counted by P(n, k) = n! / (n − k)!.

What each symbol means

n
the number of symbols available on the ring: 39.
k
how many are dialled: 7.
P(n, k)
the count of ordered selections, 39! / 32! = 77,519,922,480.
destinations
the smaller count, 1,987,690,320 — addresses that actually go somewhere, once one of the seven is spoken for.

Where the formula comes from

  1. Count the dialling directly. The first symbol has 39 choices; the second has 38, because no symbol repeats; the third 37, and so on for seven picks.
  2. Multiplying: 39 × 38 × 37 × 36 × 35 × 34 × 33. Written with factorials that is 39! / 32!, since the trailing 32! is precisely the part not used — which is the formula displayed above, = 77,519,922,480.
  3. Now fix the last glyph as the point of origin, and only six are free from the remaining 38: P(38, 6) = 38 × 37 × 36 × 35 × 34 × 33 = 1,987,690,320. That is the second number, and it is exactly the first divided by 39.

How to read what you see

Two counts side by side with the formula between them. Divide one by the other and you get exactly 39, which is the arithmetic signature of having reserved one of the seven slots.

Assumes
That no symbol repeats and that order matters. Drop the first and you would raise 39 to the seventh power instead; drop the second and you would be counting combinations, which for 7 of 39 is smaller by a factor of 7! = 5040.
Breaks when
Large counts flatter a search. Nearly two billion addresses sounds like an inexhaustible galaxy, but a permutation count says nothing about how many are valid — most sequences would point nowhere at all, exactly as most seven-letter strings are not words. Counting the possibilities is the easy half; knowing which ones mean something is the hard half, and no factorial will tell you.

Why permutations, not combinations? 🖖

A Stargate address isn't a set of symbols, it's a sequence — chevron 1 locks first, chevron 2 second, and so on, so dialing the same seven glyphs in a different order traces a completely different physical rotation path and, in the show's own logic, a different destination. That's exactly the distinction between permutations and combinations: choosing which 7 of 39 glyphs to use is a combination problem, but the dial-in itself is a permutation, and there are 7! = 5,040 ways to reorder any given set of 7 symbols. That factor of 5,040 is why P(39,7) dwarfs C(39,7) — order isn't a technicality here, it's the entire mechanism the fictional gate network runs on.

The seventh glyph is 'you are here' 🖖

In the show's logic only six glyphs pick your destination; the seventh is the point of origin — a fixed symbol identifying the gate you're dialing from, like a return address on an envelope. That's why the panel shows two counts: total addresses P(39, 7), and destination variants P(38, 6), which ignore the origin slot. The neat consequence: the total is exactly 39 times the destination count, since any of the 39 glyphs could fill that origin marker.

Seven chevrons barely cover the galaxy 🖖

The gate network spans the Milky Way, which holds an estimated 10¹¹ to 4×10¹¹ stars. Yet a 7-glyph address yields only P(39, 7) ≈ 7.75×10¹⁰ possibilities — fewer than the galaxy's stars, so seven chevrons can't give every star its own address. Switch the tool to 8 chevrons and the count jumps by a factor of 32 to about 2.48×10¹², finally outrunning the stellar census. That extra chevron isn't decoration; it's what makes the address space big enough.

Problem solved in full

  1. Checksum for a 7-glyph preset weighted by 17( i + 3) 8 steps

    The 7-glyph (stable) preset dials 3, 9, 17, 21, 28, 35, 1. The panel weights the glyph in slot i — counting from zero — by 17(i + 3), adds, and reduces mod 97. Work out the checksum by hand; then decide whether dialling two of those glyphs the wrong way round could ever pass unnoticed.

    1. Write the weights out first, because everything after this is arithmetic on them. Seven slots, seven weights, and they climb in steps of exactly 17 — that regularity is the whole engine of the proof at the end.

    2. Multiply each glyph number by its slot's weight and add. Nothing is modular yet; this is an ordinary sum, and the 17 could be factored out of every term if you preferred.

    3. Now divide by 97 and keep the remainder: 129 whole 97s fit inside 12,597 and leave 84. That is what the Checksum (mod 97) tile reads, and it is the last figure this derivation takes from the tool; everything below is yours.

    4. Here is the question the tile cannot answer. Swap the glyphs in slots i and j: every other term in the sum is untouched, so the total moves by one amount only — the two glyphs have traded weights. Expand it and the difference of the weights collapses to 17(ij), because the weights are an arithmetic progression with common difference 17.

    5. Test that formula rather than trusting it. Slots 0 and 1 hold 3 and 9, so Δ = 17(0 − 1)(9 − 3) = −102, and −102 leaves 92 mod 97 — predicting 84 + 92 = 176, which is 79. Ask the tool for the same seven glyphs with the first two exchanged, ?address=9,3,17,21,28,35,1, and the tile reads 79.

    6. For a swap to slip past, Δ must be not merely small but zero mod 97 — the checksum has to land on 84 again. So 97 must divide 17(ij)(vjvi). 97 is prime and does not divide 17, and a product is a multiple of a prime only if one of its factors already is: so 97 must divide the slot gap or the glyph gap on its own.

    7. Neither can supply it. Two different slots are at most 8 apart, because there are at most nine chevrons; two different glyphs drawn from 1 to 39 differ by at most 38. Both gaps are non-zero and both are smaller than 97, so Δ is never 0 mod 97. No transposition of two glyphs is invisible to this checksum — not for this address, and not for any address you can dial, because nine chevrons is what keeps the slot gap under 97. Hand the tool a longer address through the URL and that guarantee is the first thing to go.

    8. Catching every transposition is not the same as certifying the address, and this is where the tile quietly oversells itself. Of the 5,039 other orderings of these same seven glyphs, 62 also come out at 84 — where 97 equal buckets would give about 52. Roughly one wrong order in a hundred reads as correct. It rejects the commonest mis-dial and nothing more.

    Answer

    84 — and no swap of two glyphs can ever leave it at 84. That guarantee is a bound, though, not a property of checksums: it holds only while 97 is bigger than both the longest slot gap and the widest glyph difference. Widen the ring to 98 glyphs and it dies at once — 1, 98, 17, 21, 28, 35, 3 and 98, 1, 17, 21, 28, 35, 3 both check as 35, because their gap of 97 is annihilated by the modulus (computed here; the tool's ring stops at 39). That is precisely why IBAN check digits are taken mod 97 rather than mod 10: pick a prime larger than anything the field can vary by and every transposition is forced to show. The tool computes the checksum and says nothing about what it catches, and the 62-in-5,039 figure is the second thing it never computes — the one that stops you trusting the tile.

References (1)

Example problems

  • 7-glyph (stable) - The standard 7-symbol address — 6 destination glyphs plus your point of origin — is the backbone of the Stargate network. From a pool of 39 symbols there are 77,519,922,480 possible ordered addresses: swap two glyphs' positions and you dial a different planet entirely.
  • Earth → Abydos - The very first gate address dialed on screen: Earth to Abydos, the desert world from the 1994 film and SG-1 pilot. Same 7-glyph structure as any standard address — the order locked in chevron by chevron is what actually encodes the destination.
  • 8-glyph (long range) - Add an 8th glyph for a long-range address and the address space explodes to 2,480,637,519,360 possible orderings — 32× larger than the standard 7-symbol network, since each extra chevron multiplies the count by one more available symbol.
  • Manual (6-glyph) - Six glyphs, no point of origin: P(39, 6) = 2,349,088,560 ordered addresses. Add the seventh chevron and the count multiplies by 33, not by 39. The last symbol chooses from whatever the first six left on the ring, and that shrinking pool is the whole content of the falling factorial in the panel above.