Computational Aspects of Sturdy and Flimsy Numbers

Trevor Clokie, Thomas F. Lidbetter, Antonio Molina Lovett, Jeffrey O. Shallit, Leon Witzman

TL;DR

This paper explores "sturdy" and "flimsy" numbers, defined by the digit sums of their multiples. The authors develop algorithmic methods to identify these numbers, particularly in binary, and discover new "sturdy primes." Their work bridges number theory and computer science, using automata theory to solve computational problems.

What Problem Does This Paper Address?

The paper delves into the properties of "sturdy" and "flimsy" numbers. A number n is considered "flimsy" in base b if there exists a multiple kn whose digit sum in base b is smaller than the digit sum of n. If no such multiple exists, n is "sturdy." While the concept was introduced by Stolarsky, the computational aspects and efficient algorithms for determining sturdiness and flimsiness, especially for large numbers, remained an open challenge. The paper aims to provide algorithmic solutions to these problems, particularly focusing on base 2.

Methods

The authors employ a multi-faceted approach combining number theory with automata theory and formal language theory. Key techniques include:

  • Algorithmic Criteria: Developing criteria to determine if a number is flimsy or sturdy, reducing the problem to a finite search.
  • Automata Theory: Constructing deterministic finite automata (DFAs) and pushdown automata (PDAs) to recognize sets of numbers with specific digit sum properties. This allows for efficient checking of conditions related to digit sums of multiples.
  • Dynamic Programming: Designing dynamic programming algorithms to solve problems like finding the minimum digit sum of a multiple.
  • Formal Language Theory: Using context-free grammars and systems of equations derived from automata to analyze the asymptotic behavior of the number of flimsy numbers within certain ranges.
  • Computational Experiments: Implementing and comparing the performance of various algorithms, including those based on automata, dynamic programming, and Gröbner bases.

Datasets

Not discussed in the paper. The paper focuses on theoretical algorithms and computational results derived from these algorithms, rather than training on specific datasets.

Key Insights and Ideas

  • Automata as Number Theory Tools: The paper demonstrates the power of automata theory in solving problems in number theory, particularly for analyzing digit sum properties of numbers and their multiples.
  • Algorithmic Decidability: It's shown that determining whether a number is sturdy or flimsy is computationally decidable, and efficient algorithms exist.
  • New Sturdy Primes: The research led to the discovery of previously unknown sturdy primes, highlighting the practical application of their methods.
  • Structure of Flimsy Numbers: The work provides insights into the distribution and characterization of flimsy numbers, especially those with a limited number of zeros in their binary representation.

Key Results

  • Efficient Sturdiness Testing: Algorithms are developed that can test if a number n is sturdy in O(n) time using automata.
  • New Sturdy Primes: The authors identified two new sturdy primes: 616318177 and 2147483647.
  • Asymptotic Distributions: The paper provides asymptotic formulas for the number of k-flimsy numbers in intervals of the form [2ᴺ⁻¹, 2ᴺ), for k=3 and k=5. For example, the number of 3-flimsy numbers in this range is approximately $2^N (c N^{-1/2} + O(N^{-3/2}))$, where $c \approx 0.403$.
  • Performance Benchmarks: Timing comparisons show that automaton-based algorithms are generally faster than dynamic programming for larger inputs, with the "bfs01" algorithm performing particularly well.

Limitations and Future Work

The paper acknowledges that the dynamic programming algorithm becomes computationally infeasible for very large integers (e.g., > 10⁷). While automaton-based algorithms are more efficient, they can still be constrained by memory for extremely large inputs.

Future work suggested includes:

  • Distribution of msw(n) and mfw(n): Understanding the distribution of the minimal flimsy witness and the smallest multiple achieving the minimum digit sum for flimsy numbers is left as an open problem.
  • Generalizing to Other Bases: While the paper focuses on base 2, the methods could potentially be extended to analyze sturdy and flimsy numbers in other bases.
  • Exploring k-Equal Numbers: The paper introduces "k-equal" numbers (where s₂(n) = s₂(kn)) and provides initial results for k=3 and k=5, suggesting further investigation into their distribution.

Summary updated

BibTeX
@article{clokie2020computational,
  author = {Trevor Clokie and Thomas F. Lidbetter and Antonio Molina Lovett and Jeffrey O. Shallit and Leon Witzman},
  title = {{Computational Aspects of Sturdy and Flimsy Numbers}},
  journal = {Theoretical Computer Science},
  year = {2020},
  doi = {10.1016/j.tcs.2022.05.029},
}
Figure