Skip to content

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 16 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 16 of our test runs on , through OpenRouter with the app's own prompt and settings. Updated .

Short answer

All 16 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 1.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 16 models on this prompt, in catalog order.

Every model's reply to “Four-digit numbers whose digits sum to 9”
ModelResultCostTimeReply
Claude Fable 5.1AnthropicPassed: Final answer 165: right.$0.01394.6 s175 tokens
Claude Opus 5.5AnthropicPassed: Final answer 165: right.$0.00774.7 s191 tokens
Claude Sonnet 5.5AnthropicPassed: Final answer 165: right.$0.00261.8 s161 tokens
Claude Sonnet 5AnthropicPassed: Final answer 165: right.$0.00394.5 s179 tokens
Claude Haiku 4.5AnthropicPassed: Final answer 165: right.$0.00242.9 s404 tokens
GPT-6 AstraOpenAIPassed: Final answer 165: right.$0.01223.8 s134 tokens
GPT-6 SolOpenAIPassed: Final answer 165: right.$0.00192.5 s78 tokens
GPT-6 LunaOpenAIPassed: Final answer 165: right.$0.000102.0 s77 tokens
Gemini 3.1 Pro (preview)GooglePassed: Final answer 165: right.$0.01509.6 s355 tokens
Gemini 3.8 FlashGooglePassed: Final answer 165: right.$0.00224.7 s235 tokens
DeepSeek V4.1 FlashDeepSeekPassed: Final answer 165: right.$0.000251.7 s112 tokens
DeepSeek V4 ProDeepSeekPassed: Final answer 165: right.$0.000613.2 s120 tokens
Grok 4.7xAIPassed: Final answer 165: right.$0.005611.1 s145 tokens
Kimi K3MoonshotPassed: Final answer 165: right.$0.00326.0 s122 tokens
GLM 5.3Z.aiPassed: Final answer 165: right.$0.000251.9 s154 tokens
GLM 5.3 FlashZ.aiPassed: Final answer 165: right.$0.000122.7 s117 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.

  1. 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: 165

    378 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 ·

  2. 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 ·

  3. DeepSeek V4.1 Flash

    Passed: Final answer 165: right.

    Let the digits be $a,b,c,d$ with $a \ge 1$ (four-digit) and $b,c,d \ge 0$, and $a+b+c+d=9$.
    
    Set $a' = a-1 \ge 0$. Then $a'+b+c+d = 8$.
    
    Number of nonnegative solutions to a sum of 8 across 4 variables:
    
    $$\binom{8+4-1}{4-1} = \binom{11}{3} = 165$$
    
    Final answer: 165

    417 tokens in, 216 out (104 of them reasoning) · 1.7 s · $0.0002 · 1 message on Pro · answered by deepseek/deepseek-v4.1-flash via Novita ·

  4. 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: 165

    392 tokens in, 154 out · 1.9 s · $0.0003 · 1 message on Pro · answered by z-ai/glm-5.3 via Baidu ·

  5. DeepSeek V4 Pro

    Passed: Final answer 165: right.

    Let the four-digit number be \(abcd\), with \(a \in \{1,\dots,9\}\) and \(b,c,d \in \{0,\dots,9\}\).
    
    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: 165

    389 tokens in, 218 out (98 of them reasoning) · 3.2 s · $0.0006 · 1 message on Pro · answered by deepseek/deepseek-v4-pro-0813 via Alibaba ·

  6. 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: 165

    378 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 ·

  7. 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: 165

    404 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 ·

  8. 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: 165

    404 tokens in, 404 out · 2.9 s · $0.0024 · 1 message on Pro · answered by anthropic/claude-haiku-4.5 via Amazon Bedrock ·

  9. 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 ·

  10. 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: 165

    465 tokens in, 332 out (210 of them reasoning) · 6.0 s · $0.0032 · 1 message on Pro · answered by moonshotai/kimi-k3 via Wafer ·

  11. 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 ·

  12. Grok 4.7

    Passed: Final answer 165: right.

    The four-digit positive integers \(ABCD\) (with \(A \in \{1,\dots,9\}\) and \(B,C,D \in \{0,\dots,9\}\)) whose digits sum to 9 are in bijection with the non-negative integer solutions of \(A' + B + C + D = 8\) via the change of variables \(A' = A - 1\).  
    
    No variable can exceed 8, so the upper bounds of 9 are automatically satisfied. The number of solutions is therefore
    \[
    \binom{8+4-1}{3} = \binom{11}{3} = 165.
    \]
    
    Final answer: 165

    1,613 tokens in, 925 out (780 of them reasoning) · 11.1 s · $0.0056 · 1 message on Pro · answered by x-ai/grok-4.7 via xAI ·

  13. 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: 165

    512 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 ·

  14. 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: 165

    378 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 ·

  15. 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 ·

  16. 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: 165

    404 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 16 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 1.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, and GLM, 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.