I slept that night in a stairwell with my back against the cold wall and forty-five marks sewn into my sleeve, which is how I learned that Tier F wakes up early.

At the first bell, Pim found me. He was carrying two bowls of porridge he had definitely not paid for, and a slate with a long column of numbers on it.

"I did what you said," he whispered. "I wrote down every chest roll I could see yesterday after you left. There's more than the coin."

"There's more than the coin," I agreed. "Show me."

The Coin Hall had a second attraction, a wall of ornate bronze chests set into the east side, each with a brass dial on its lid. Pay five marks, press the dial, and the lid would flip open to show a number from 0 to 255 glowing on a stone tablet, then dispense a reward. The rule was posted on a placard above the row:

**ROLL 0-239: TWO MARKS. ROLL 240-255: RESOLVE STONE (WORTH 80 MARKS TO ANY GUILD). ONE CHEST, ONE ROLL.**

"One chest, one roll," Pim said. "But I counted. It's *one* chest. The others are decoration. There's one tablet behind the wall, and it shows the same dial result on every lid. Everybody pulls from the same pile."

"One shared stream," I said. "That's good. That's very good."

On Pim's slate were five consecutive pulls, in the order they happened. He'd marked them by timestamps, the Hall's own bell tolls. I ran a finger down it.

**17. 88. 187. 170. 85...**

I stopped.

"What?" Pim said.

"These were consecutive?"

"I watched every one. Hall's slow before the second bell. I wrote them as they came."

I looked at the first three numbers and felt the old click. 17, then 88, then 187. Not a pattern you could see. A pattern you could *feel*, the way a drummer feels a missing beat.

"The coin was a counter," Pim said, watching my face. "Is this one a counter too?"

"Not quite. A counter goes up by one. This goes up by something else." I took the chalk out of my sleeve and a flat slate from the wall. "The chest is a different kind of machine. It takes the last number it gave, does the same arithmetic on it every time, and wraps around when it overflows. The rule has two unknowns. I'll call them *a* and *c*. Next number equals *a* times the last, plus *c*, then wrap at two hundred and fifty-six, because the numbers can't get past 255."

"Why two hundred and fifty-six?"

"Because it's the smallest number that fits everything the tablet shows, and because it's a power of two. Computers like powers of two." I wrote the rule on the slate:

**x(next) = (a · x + c) mod 256**

"Three numbers, two unknowns. I think that's enough."

He sat down. I think he'd been waiting his whole life for someone to say *I think that's enough* to him about something.

"Start with the differences," I said. "If I subtract one roll from the next, the *c* cancels out. Watch. The second roll minus the first is a times the first minus a times zero... no, careful. Let me write it cleanly." I drew:

x₁ = a·x₀ + c x₂ = a·x₁ + c

"Subtract them. x₂ minus x₁ equals a times (x₁ minus x₀). The *c* vanishes." I tapped it. "So the ratio of two consecutive differences is a."

"88 minus 17 is 71," Pim said, scribbling. "187 minus 88 is 99. So 99 divided by 71?"

"Right. But dividing doesn't work normally when everything wraps at 256. You can't divide, you have to multiply by something that undoes 71. A modular inverse. A number that, when multiplied by 71 and wrapped at 256, gives 1. It exists, because 71 is odd and 256 has no odd factors."

"That sounds like a hard thing to find."

"Not if you're lazy." I did it the old way, with Euclid's trick: 256 is three 71s and a remainder of 43. 71 is one 43 and a remainder of 28. 43 is one 28 and a remainder of 15. 28 is one 15 and 13. 15 is one 13 and 2. 13 is six 2s and 1. Then you walk it backward, swapping each remainder out for the one before until everything is a mix of 71 and 256 and the end is a 1. It took me about forty seconds, and Pim watched the chalk like it was a magic trick.

"One hundred and nineteen," I said.

"Is that right?"

"Check it. 71 times 119." He did it on the slate with his tongue between his teeth. "8,449," he said. "And 256 times 33 is 8,448." His eyes got big. "It's one more! It's one! It *works*."

"So a equals 99 times 119, wrapped at 256." Eleven thousand seven hundred and eighty-one. I subtracted forty-six lots of 256, which is eleven thousand seven hundred and seventy-six. "Five."

"Five."

"Then c is easy." 88 minus five times 17, which is eighty-five. "Three."

I wrote the finished rule underneath, and then I wrote the next number the chest should give after 187, to see whether the whole thing held:

5 × 187 = 935. 935 + 3 = 938. 938 − 768 = **170**.

Pim's slate had 170 right below 187.

"Then 85," he said, hoarse. "5 times 170 is 850, plus three, 853, minus 768, that's 85!"

"And after that?"

"172."

"It will be 172, then 95, then 222, then 89." I wrote the whole row and tapped the last one. "Every number the chest will ever say is on this wall already, because the chest has no secrets. It has two numbers in a hat and a rule that never changes."


We tested it properly. I'd have been ashamed of anything else.

I made Pim write a prediction on the slate *before* he bought each pull: the next number, and the next after that. Then he'd watch the chest. If the tablet disagreed, we would stop, call the model dead, and start over. Five marks each. We kept going until the tablet had matched three in a row past the ones we'd derived from, because one match is luck and two is an invitation, but three called aloud before they landed is evidence.

"Why does it never repeat?" Pim asked in the pause between bets. "A number could come twice, right?"

"It could, if the rule were bad. But this one's good, and I can prove it." He gave me a look. "A rule like this goes through every number from 0 to 255 exactly once before coming back to its start, if two things hold. The *c* has to be odd, and the *a*, minus one, has to be a multiple of four. Three is odd. Five minus one is four. Whoever wrote this took care to make it a perfect loop of two hundred and fifty-six steps. No repeats and no gaps."

"That's a weirdly nice thing to do for a death game."

"They wanted it fair, at least on the surface." I said it too fast. "Fair-looking."

Pim was quiet a moment. "Kai. When you do the... when you say 'wrap'... you keep doing this thing with your hands."

I looked down. My fingers were tapping against my knee: not random, but a steady rhythm of long and short taps that I hadn't chosen. I recognized the pattern a moment later, with a feeling like missing a stair in the dark.

I had been tapping out numbers.

One six six four five two five.

One zero one three nine zero four two two three.

"What's that?" said Pim.

"I don't know." It was true. I had been muttering something under my breath for as long as I'd been working. I hadn't heard it. "Those are... I know those. They're constants. Numbers that go with generators like this one. A big multiplier and a big increment. I recite them when I'm thinking, like a lucky charm, and I can't say where I learned them."

"Did you make them up?"

"No. They're real. Somebody published them." I rubbed my forehead. "Everybody used them. They're in every textbook. I've got them in my head the way you've got a song from a bad movie. It's nothing."

"You said it like it was something."

"It's *nothing*." I wasn't sure who I was convincing. I wrote both numbers on the wall in chalk anyway, because writing a thing down is the only way I've ever known to make it hold still. 1664525. 1013904223. They looked ordinary and ancient, and I didn't like them any more than I liked the last time I'd seen the Priest's coin tick.


The twentieth pull from the chest, on our reckoning, was a 250.

I'd checked it more times than I'd checked anything in my life. The arithmetic ran from the last number the tablet had shown, 222, by repeated stepping: 89, 192, 195, 210, 29, 148, 231, 134, 161, 40, 203, 250. Each of those steps was a pull someone else would make. If I'd done the math right, the chest would say 250 on the twelfth pull from now. 250 was above 240. 250 was a Resolve Stone.

So we waited, and watched other people feed the machine. Ten pulls went by. I kept count out loud, and every tablet number matched my slate, and every time I murmured the next one a little louder, a woman in a green coat at the front of the line shot me a look that was equal parts suspicion and fascination.

"Eleven," Pim breathed.

The man ahead of me paid his five marks and got a two for it. The tablet flickered. The chest swallowed my turn.

I paid five marks and pressed the dial.

The lid flipped open. The stone tablet blazed: **250**.

A black gem the size of a hen's egg dropped into my hand, warm and heavy. The Hall made a noise I can only describe as a polite riot. Somebody laughed. Somebody swore. Pim let out a whoop and then covered his mouth with both hands and looked mortified.

"Eighty marks," said the clerk-statue, as if it were reading a weather report.

I stared at the stone in my palm. I had thirty-one marks of my own now, after the day's spending, and a gem worth eighty more. It was exactly what I'd needed. More than that: it was a receipt. It was a thing nobody could say was luck, because I'd written it down, in advance, in chalk, and a hundred people had watched the numbers come true.

It should have been the best moment since I woke up.

But I kept looking at the two big numbers on the wall behind me, the ones I had written because my hands wanted to, and I kept thinking that the person who'd made this machine had liked those numbers too, and I did not know why that made me want to sit down on the floor.