digit_dp
Count integers from 1 to N whose digit sum equals a target value, using digit DP to handle large upper bounds.
Instructions
Count integers from 1 to N whose digit sum equals a target value using digit DP.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"n": "<n>",
"target_digit_sum": "<target_digit_sum>"
},
"name": "digit_dp"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| n | Yes | Upper bound (positive integer, max 1e15) | |
| target_digit_sum | Yes | Target digit sum (0-135) |