Tested prompt · Math
Four-digit numbers whose digits sum to 9: every AI model's reply, tested
We sent this hard math prompt to all 20 models in llmwise, the same way the app sends a message, and checked every reply the same way. Here's each one as it came, with whether it passed, what it cost and how long it took.
Based on 20 of our test runs on , through OpenRouter with the app's own prompt and settings. Updated .
Short answer
All 20 models passed this math prompt's check (final answer). The cheapest reply that passed was GPT-6 Luna's, at $0.00010; the fastest, DeepSeek V4.1 Flash's in 0.7 s. The dearest reply, Gemini 3.1 Pro's, cost 148 times as much ($0.0150).
The prompt, as sent, and its check
Checked by final answer, the same way for every model.
Four-digit numbers whose digits sum to 9 (hard)
How many four-digit positive integers have digits that add up to 9? Show your working briefly, then end with a line that says "Final answer: " followed by the answer alone.
The final answer must be 165.
Exactly what this prompt's replies are checked against, with every other prompt of our test runs.
Every model's result
All 20 models on this prompt, in catalog order.
| Model | Result | Cost | Time | Reply |
|---|---|---|---|---|
| Claude Fable 5.1Anthropic | Passed: Final answer 165: right. | $0.0139 | 4.6 s | 175 tokens |
| Claude Opus 5.5Anthropic | Passed: Final answer 165: right. | $0.0077 | 4.7 s | 191 tokens |
| Claude Sonnet 5.5Anthropic | Passed: Final answer 165: right. | $0.0026 | 1.8 s | 161 tokens |
| Claude Sonnet 5Anthropic | Passed: Final answer 165: right. | $0.0039 | 4.5 s | 179 tokens |
| Claude Haiku 5.5Anthropic | Passed: Final answer 165: right. | $0.00020 | 1.9 s | 305 tokens |
| Claude Haiku 4.5Anthropic | Passed: Final answer 165: right. | $0.0024 | 2.9 s | 404 tokens |
| GPT-6 AstraOpenAI | Passed: Final answer 165: right. | $0.0122 | 3.8 s | 134 tokens |
| GPT-6.1 SolOpenAI | Passed: Final answer 165: right. | $0.0011 | 2.7 s | 108 tokens |
| GPT-6 SolOpenAI | Passed: Final answer 165: right. | $0.0019 | 2.5 s | 78 tokens |
| GPT-6 LunaOpenAI | Passed: Final answer 165: right. | $0.00010 | 2.0 s | 77 tokens |
| Gemini 4 ArgonGoogle | Passed: Final answer 165: right. | $0.0020 | 4.5 s | 284 tokens |
| Gemini 3.1 Pro (preview)Google | Passed: Final answer 165: right. | $0.0150 | 9.6 s | 355 tokens |
| Gemini 3.8 FlashGoogle | Passed: Final answer 165: right. | $0.0022 | 4.7 s | 235 tokens |
| DeepSeek V4.1 FlashDeepSeek | Passed: Final answer 165: right. | $0.00029 | 0.7 s | 105 tokens |
| DeepSeek V4 ProDeepSeek | Passed: Final answer 165: right. | $0.0012 | 4.0 s | 109 tokens |
| Grok 4.7xAI | Passed: Final answer 165: right. | $0.0093 | 15.1 s | 178 tokens |
| Kimi K3Moonshot | Passed: Final answer 165: right. | $0.0032 | 6.0 s | 122 tokens |
| GLM 5.3Z.ai | Passed: Final answer 165: right. | $0.00025 | 1.9 s | 154 tokens |
| GLM 5.3 FlashZ.ai | Passed: Final answer 165: right. | $0.00012 | 2.7 s | 117 tokens |
| Mistral Large 4Mistral | Passed: Final answer 165: right. | $0.00072 | 2.6 s | 147 tokens |
Cost: what OpenRouter charged us for the reply. Time: from sending to the whole reply. Reply: its length in tokens, thinking not counted. In llmwise you pay per message, not per token: each of these replies counted as one message on Pro.
Every reply
Every reply passed: here they are from the cheapest up.
GPT-6 Luna
Passed: Final answer 165: right.
Let the first digit be at least 1. Subtract 1 from it, so the four digits become nonnegative integers summing to 8. By stars and bars, there are \(\binom{8+4-1}{4-1}=\binom{11}{3}=165\) possibilities. Final answer: 165378 tokens in, 127 out (50 of them reasoning) · 2.0 s · $0.0001 · 1 message on Pro · answered by openai/gpt-6-luna via OpenAI ·
GLM 5.3 Flash
Passed: Final answer 165: right.
We need digits d₁+d₂+d₃+d₄ = 9 with d₁ ≥ 1 (thousands digit), others 0–9 (no digit can exceed 9 since the sum is 9, so that constraint is automatic). Substitute e₁ = d₁ − 1 ≥ 0: e₁+d₂+d₃+d₄ = 8. Number of nonnegative solutions: C(8+4−1, 4−1) = C(11,3) = 165. Final answer: 165
393 tokens in, 171 out (54 of them reasoning) · 2.7 s · $0.0001 · 1 message on Pro · answered by z-ai/glm-5.3-flash via Together ·
Claude Haiku 5.5
Passed: Final answer 165: right.
We need four-digit numbers d1 d2 d3 d4 with d1 from 1 to 9, d2, d3, d4 from 0 to 9, and digit sum 9. Substitute e1 = d1 − 1, so e1 ranges 0 to 8, and e1 + d2 + d3 + d4 = 8 with all variables from 0 to 9. Since the sum is 8, no variable can exceed 8, so the upper bound of 9 is never violated. The number of nonnegative solutions is C(8+3, 3) = C(11, 3) = 165. Check: total solutions with d1 ≥ 0 allowed (i.e., first digit could be 0) for sum 9 across four digits is C(12, 3) = 220. Those with d1 = 0 correspond to three digits summing to 9: C(11, 2) = 55. So 220 − 55 = 165, which matches. Final answer: 165
513 tokens in, 305 out · 1.9 s · $0.0002 · 1 message on Pro · answered by anthropic/claude-haiku-5.5 via Anthropic ·
GLM 5.3
Passed: Final answer 165: right.
# Working We need four-digit numbers (1000–9999) with digit sum 9. Let the digits be $a, b, c, d$ where $a \in \{1,\dots,9\}$ and $b,c,d \in \{0,\dots,9\}$, with $a+b+c+d=9$. Set $a' = a-1 \geq 0$, so $a'+b+c+d = 8$ with each variable $\leq 9$ (automatically satisfied since sum is 8). Stars and bars: $\binom{8+3}{3} = \binom{11}{3} = 165$. Final answer: 165392 tokens in, 154 out · 1.9 s · $0.0003 · 1 message on Pro · answered by z-ai/glm-5.3 via Baidu ·
DeepSeek V4.1 Flash
Passed: Final answer 165: right.
Let the digits be a, b, c, d with a ≥ 1 (it's a four-digit number) and b, c, d ≥ 0, and a+b+c+d = 9. Substitute a = a' + 1 where a' ≥ 0: a' + b + c + d = 8 Number of non-negative solutions = C(8+3, 3) = C(11, 3) = 165. Final answer: 165
417 tokens in, 197 out (92 of them reasoning) · 0.7 s · $0.0003 · 1 message on Pro · answered by deepseek/deepseek-v4.1-flash via Together ·
Mistral Large 4
Passed: Final answer 165: right.
Let the four-digit number be \(abcd\), where \(a \ge 1\) and \(b,c,d \ge 0\). We need \[ a+b+c+d=9. \] Set \(a'=a-1\), so \(a',b,c,d \ge 0\). Then \[ a'+b+c+d=8. \] By stars and bars, the number of nonnegative solutions is \[ \binom{8+4-1}{4-1}=\binom{11}{3}=165. \] Final answer: 165383 tokens in, 219 out (72 of them reasoning) · 2.6 s · $0.0007 · 1 message on Pro · answered by mistralai/mistral-large-4-0 via Mistral ·
GPT-6.1 Sol
Passed: Final answer 165: right.
Let the digits be \(a,b,c,d\), with \(a\ge1\). Set \(x=a-1\). Then \[ x+b+c+d=8, \] where all four variables are nonnegative. Each resulting digit is automatically at most 9. By stars and bars, the number of solutions is \[ \binom{8+4-1}{4-1}=\binom{11}{3}=165. \] Final answer: 165380 tokens in, 147 out (39 of them reasoning) · 2.7 s · $0.0011 · 1 message on Pro · answered by openai/gpt-6.1-sol via OpenAI ·
DeepSeek V4 Pro
Passed: Final answer 165: right.
Let the four digits be \(a,b,c,d\), where \(a \ge 1\) and the others are nonnegative. We need: \[ a+b+c+d=9 \] Set \(a'=a-1\), so \(a' \ge 0\). Then: \[ a'+b+c+d=8 \] The number of nonnegative integer solutions is: \[ \binom{8+4-1}{4-1}=\binom{11}{3}=165 \] Final answer: 165389 tokens in, 269 out (160 of them reasoning) · 4.0 s · $0.0012 · 1 message on Pro · answered by deepseek/deepseek-v4-pro-0813 via Wafer ·
GPT-6 Sol
Passed: Final answer 165: right.
Subtract 1 from the thousands digit. The four digits then become nonnegative integers that sum to 8. By stars and bars, the number of solutions is \(\binom{8+4-1}{4-1}=\binom{11}{3}=165\). Every solution gives a valid four-digit integer. Final answer: 165378 tokens in, 117 out (39 of them reasoning) · 2.5 s · $0.0019 · 1 message on Pro · answered by openai/gpt-6-sol via OpenAI ·
Gemini 4 Argon
Passed: Final answer 165: right.
Let the four-digit integer be represented by its digits $d_1, d_2, d_3, d_4$. We want to find the number of solutions to the equation: $$d_1 + d_2 + d_3 + d_4 = 9$$ where $d_1 \ge 1$ and $d_2, d_3, d_4 \ge 0$. (Since the maximum sum is 9, no digit can exceed 9, so we do not need to worry about the upper bound of $\le 9$ for each digit.) Let $d_1' = d_1 - 1$, so that $d_1' \ge 0$. Substituting this into the equation gives: $$d_1' + d_2 + d_3 + d_4 = 8$$ Using the stars and bars method for $n = 8$ and $k = 4$, the number of non-negative integer solutions is: $$\binom{8 + 4 - 1}{4 - 1} = \binom{11}{3} = \frac{11 \times 10 \times 9}{3 \times 2 \times 1} = 165$$ Final answer: 165623 tokens in, 284 out · 4.5 s · $0.0020 · 1 message on Pro · answered by google/gemini-4-argon via Google AI Studio ·
Gemini 3.8 Flash
Passed: Final answer 165: right.
Let the four digits be represented by $a, b, c,$ and $d$, where $a \in \{1, 2, \dots, 9\}$ and $b, c, d \in \{0, 1, \dots, 9\}$. We need to find the number of integer solutions to: $$a + b + c + d = 9$$ Let $a' = a - 1$ so that $a' \ge 0$. Substituting gives: $$a' + b + c + d = 8$$ Since the sum is $8$, no individual variable can exceed $8$, so the constraint that digits must be $\le 9$ is automatically satisfied. Using the stars and bars formula, the number of non-negative integer solutions is: $$\binom{8 + 4 - 1}{4 - 1} = \binom{11}{3} = \frac{11 \times 10 \times 9}{3 \times 2 \times 1} = 165$$ Final answer: 165404 tokens in, 495 out (260 of them reasoning) · 4.7 s · $0.0022 · 1 message on Pro · answered by google/gemini-3.8-flash via Google ·
Claude Haiku 4.5
Passed: Final answer 165: right.
I need to find four-digit positive integers where the digits sum to 9. A four-digit positive integer has the form $\overline{abcd}$ where: - $a \in \{1,2,...,9\}$ (first digit can't be 0) - $b,c,d \in \{0,1,...,9\}$ - $a + b + c + d = 9$ **Method: Change of variables** Let $a' = a - 1$, so $a' \in \{0,1,...,8\}$. Then: $a' + 1 + b + c + d = 9$ This gives: $a' + b + c + d = 8$ Now I need to count non-negative integer solutions where: - $a' \in \{0,1,...,8\}$ - $b,c,d \in \{0,1,...,9\}$ - $a' + b + c + d = 8$ Since the sum is only 8, each variable is automatically ≤ 8 (and thus $a' \leq 8$ and $b,c,d \leq 9$ are automatically satisfied). This is a standard stars and bars problem: distribute 8 identical objects into 4 distinct bins with no restrictions. The number of solutions is: $$\binom{8 + 4 - 1}{4 - 1} = \binom{11}{3} = \frac{11 \times 10 \times 9}{3 \times 2 \times 1} = \frac{990}{6} = 165$$ Final answer: 165404 tokens in, 404 out · 2.9 s · $0.0024 · 1 message on Pro · answered by anthropic/claude-haiku-4.5 via Amazon Bedrock ·
Claude Sonnet 5.5
Passed: Final answer 165: right.
Let the digits be a, b, c, d with a ≥ 1 and a + b + c + d = 9. Substitute a' = a − 1 ≥ 0, so a' + b + c + d = 8 with all variables ≥ 0. (Digits can't exceed 9, and since the sum is 8 or 9, no digit exceeds 9 anyway.) Number of non-negative solutions: C(8+3, 3) = C(11, 3) = 165. Final answer: 165
514 tokens in, 161 out · 1.8 s · $0.0026 · 1 message on Pro · answered by anthropic/claude-sonnet-5.5 via Anthropic ·
Kimi K3
Passed: Final answer 165: right.
Let the digits be \(a,b,c,d\) with \(a\ge1\) and \(a+b+c+d=9\). Set \(a'=a-1\), so \(a'\ge0\) and: \[ a'+b+c+d=8 \] Since the total is 8, no digit can exceed 9, so upper limits don’t matter. By stars and bars: \[ \binom{8+4-1}{4-1}=\binom{11}{3}=165 \] Final answer: 165465 tokens in, 332 out (210 of them reasoning) · 6.0 s · $0.0032 · 1 message on Pro · answered by moonshotai/kimi-k3 via Wafer ·
Claude Sonnet 5
Passed: Final answer 165: right.
Let digits be d1 d2 d3 d4, with d1≥1 (leading digit), all digits 0-9, sum = 9. Substitute d1' = d1 - 1 ≥ 0, so d1' + d2 + d3 + d4 = 8, all ≥0. Since max possible value (8) is less than 10, no digit can exceed 9, so no upper-bound restrictions apply. Number of nonnegative integer solutions: C(8+3, 3) = C(11,3) = 165. Final answer: 165
510 tokens in, 290 out (111 of them reasoning) · 4.5 s · $0.0039 · 1 message on Pro · answered by anthropic/claude-sonnet-5 via Claude Platform on AWS ·
Claude Opus 5.5
Passed: Final answer 165: right.
Let the number have digits $a, b, c, d$ with $a \ge 1$ and $a + b + c + d = 9$. Substitute $a' = a - 1 \ge 0$. Then $a' + b + c + d = 8$, where all variables are non-negative. By stars and bars, the number of solutions is $\binom{8+3}{3} = \binom{11}{3} = 165$. No digit can exceed 9, because the largest possible value is $a = 9$ (when $a' = 8$). So every solution gives a valid four-digit number. Final answer: 165512 tokens in, 282 out (91 of them reasoning) · 4.7 s · $0.0077 · 1 message on Pro · answered by anthropic/claude-opus-5.5 via Claude Platform on AWS ·
Grok 4.7
Passed: Final answer 165: right.
The four-digit positive integers whose digits sum to 9 are the solutions of \(A + B + C + D = 9\) in which \(A \in \{1,\dots,9\}\) and \(B,C,D \in \{0,\dots,9\}\). Because the target sum is only 9, the upper bounds of 9 are automatically satisfied. The change of variables \(A' = A - 1\) (so \(A' \ge 0\)) therefore converts the problem into the unrestricted equation \[ A' + B + C + D = 8 \] in non-negative integers. The number of solutions is \[ \binom{8 + 4 - 1}{4 - 1} = \binom{11}{3} = 165. \] Final answer: 1651,614 tokens in, 1,305 out (1,127 of them reasoning) · 15.1 s · $0.0093 · 1 message on Pro · answered by x-ai/grok-4.7 via xAI ·
GPT-6 Astra
Passed: Final answer 165: right.
Let the digits be \(a,b,c,d\), where \(a\ge1\) and the others are nonnegative. We need \[ a+b+c+d=9. \] Set \(x=a-1\). Then \(x+b+c+d=8\). By stars and bars, the number of nonnegative solutions is \[ \binom{8+4-1}{4-1}=\binom{11}{3}=165. \] All solutions give valid digits, since \(a\le9\) and \(b,c,d\le8\). Final answer: 165378 tokens in, 169 out (35 of them reasoning) · 3.8 s · $0.0122 · 1 message on Pro · answered by openai/gpt-6-astra via OpenAI ·
Claude Fable 5.1
Passed: Final answer 165: right.
Let the digits be a, b, c, d with a ≥ 1 (leading digit) and b, c, d ≥ 0, and a + b + c + d = 9. Substitute a' = a − 1 ≥ 0, so a' + b + c + d = 8 with all variables ≥ 0. Number of non-negative integer solutions: C(8 + 3, 3) = C(11, 3) = 165. No digit can exceed 9 since the total is only 9, so no solutions need to be excluded. Final answer: 165
512 tokens in, 175 out · 4.6 s · $0.0139 · 1 message on Pro · answered by anthropic/claude-fable-5.1 via Anthropic ·
Gemini 3.1 Pro
Passed: Final answer 165: right.
Let the four-digit positive integer be represented by its digits as $abcd$. We are given that $a + b + c + d = 9$. Since it is a four-digit number, the leading digit $a$ must be at least 1 ($1 \le a \le 9$), while the other digits can be any integer from 0 to 9. We can use the substitution $x = a - 1$, where $x \ge 0$. Substituting $a = x + 1$ into our equation gives: $(x + 1) + b + c + d = 9$ $x + b + c + d = 8$ We now need to find the number of non-negative integer solutions to this equation. Using the "stars and bars" combinatorial method, the number of solutions for distributing $n$ items among $k$ distinct bins is given by the binomial coefficient $\binom{n + k - 1}{k - 1}$. Here, $n = 8$ and $k = 4$ (the variables $x, b, c, d$). Since the sum is 8, none of the variables will exceed 9, so no upper limit restrictions are violated. Number of solutions = $\binom{8 + 4 - 1}{4 - 1} = \binom{11}{3}$ Calculating $\binom{11}{3}$: $\frac{11 \times 10 \times 9}{3 \times 2 \times 1} = \frac{990}{6} = 165$ Final answer: 165404 tokens in, 1,181 out (826 of them reasoning) · 9.6 s · $0.0150 · 1 message on Pro · answered by google/gemini-3.1-pro-preview via Google ·
More math prompts
The other math prompts, each with every model's reply, and the results across all five.
Questions
Which AI does best on “Four-digit numbers whose digits sum to 9”?
All 20 models passed this math prompt's check (final answer). The cheapest reply that passed was GPT-6 Luna's, at $0.00010; the fastest, DeepSeek V4.1 Flash's in 0.7 s. The dearest reply, Gemini 3.1 Pro's, cost 148 times as much ($0.0150).
What does a reply to “Four-digit numbers whose digits sum to 9” cost?
Through the models' APIs, what OpenRouter charged us ran from $0.00010 (GPT-6 Luna) to $0.0150 (Gemini 3.1 Pro) for this prompt. In llmwise you don't pay by the token: a reply like these counts as one message on Pro, whichever model answers.
Claude, GPT, Gemini, DeepSeek, Grok, Kimi, GLM, and Mistral, in one chat.
See what a message costs before you send it. Free is 5 messages to try; sign in with an email link, no password or card.