How to Find the Smallest Base for a 135-Digit Polynomial Value
Question details
Calculate the smallest integer base that converts a ten-character Unicode string into a value with at least 135 decimal digits.

- Product
- Programming / Math
- Device & OS
- not provided
- Scenario
- Evaluating a polynomial based on string characters to reach a large numerical threshold (10^134).
- Observed behavior
- The goal is to determine the exact minimum base using Horner's method, binary search, and arbitrary-precision integer arithmetic to prevent floating-point inaccuracies.
Ensure you have a programming environment like Python installed, as standard spreadsheet software cannot handle 135-digit arbitrary-precision arithmetic natively.
Use Horner's Method and Binary Search in Python
Write a Python script using built-in arbitrary-precision integers to efficiently evaluate the polynomial and search for the minimum base.
Because the target is a 135-digit number, the minimum required value is 10^134. Since the polynomial value strictly increases as the base increases (monotonicity), binary search is the most efficient way to pinpoint the exact smallest base.
Extract the numerical value of each character in the 10-character string using the built-in `ord(character)` function.
Write a function to evaluate the polynomial iteratively. Using the formula `value = value * base + ord(character)`, iterate through the string characters. This requires fewer multiplications than calculating powers directly.
Set your lower bound to 2. To find the upper bound, start with a small base and repeatedly increase it (e.g., doubling it) until the evaluated polynomial value meets or exceeds the target `10**134`.
Write a loop that calculates the midpoint between the lower and upper bounds. If the polynomial evaluated at the midpoint base is greater than or equal to `10**134`, lower the upper bound. Otherwise, raise the lower bound until the exact minimum base is found.

Document Algorithms and Code Using WPS Writer
While spreadsheets cannot natively process 135-digit arbitrary-precision numbers, you can use WPS Writer to professionally document your algorithms, format Python code snippets, and display complex polynomial math.
- 1. Create a new document: Open WPS Office, select 'Writer', and click 'Blank Document' to start your technical documentation.
- 2. Insert math formulas: Navigate to the 'Insert' tab and click 'Equation' to typeset your base polynomial calculation clearly.
- 3. Format your code: Paste your Python script into the document, select the text, and use a monospaced font like Courier New from the 'Home' tab for readability.
- 4. Save and export: Click 'Menu' > 'Export to PDF' to create a clean, shareable document of your mathematical solution.

Frequently Asked Questions
Why is 10^134 used as the target for a 135-digit number?
In base-10, the smallest possible number with N digits is 10^(N-1). Therefore, the absolute smallest value that takes up 135 decimal digits is a 1 followed by 134 zeros, which is exactly 10^134.
What makes Horner's method better than standard polynomial evaluation?
Horner's method factors out the base at each step, restructuring the polynomial as `(...((a₀ × b + a₁) × b + a₂) ... × b + aₙ)`. This reduces the computational complexity from O(n^2) multiplications to O(n), which is significantly faster for computer algorithms.
Can I use Excel or WPS Spreadsheet to calculate this base?
Standard spreadsheet applications limit number precision to 15 significant digits (IEEE 754 standard). Because calculating a 135-digit polynomial requires exact arbitrary precision, you must use a programming language like Python that supports infinitely large integers.




