Sums of Palindromes: an Approach via Automata

Authors Aayush Rajasekaran, Jeffrey Shallit, Tim Smith

Thumbnail PDF


  • Filesize: 482 kB
  • 12 pages

Document Identifiers

Author Details

Aayush Rajasekaran
Jeffrey Shallit
Tim Smith

Cite AsGet BibTex

Aayush Rajasekaran, Jeffrey Shallit, and Tim Smith. Sums of Palindromes: an Approach via Automata. In 35th Symposium on Theoretical Aspects of Computer Science (STACS 2018). Leibniz International Proceedings in Informatics (LIPIcs), Volume 96, pp. 54:1-54:12, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2018)


Recently, Cilleruelo, Luca, & Baxter proved, for all bases b >= 5, that every natural number is the sum of at most 3 natural numbers whose base-b representation is a palindrome. However, the cases b = 2, 3, 4 were left unresolved. We prove, using a decision procedure based on automata, that every natural number is the sum of at most 4 natural numbers whose base-2 representation is a palindrome. Here the constant 4 is optimal. We obtain similar results for bases 3 and 4, thus completely resolving the problem.
  • finite automaton
  • nested-word automaton
  • decision procedure
  • palindrome
  • additive number theory


  • Access Statistics
  • Total Accesses (updated on a weekly basis)
    PDF Downloads


  1. Rajeev Alur and P. Madhusudan. Visibly pushdown languages. In László Babai, editor, Proceedings of the 36th Annual ACM Symposium on Theory of Computing, Chicago, IL, USA, June 13-16, 2004, pages 202-211. ACM, 2004. URL:
  2. Rajeev Alur and P. Madhusudan. Adding nesting structure to words. J. ACM, 56(3):16:1-16:43, 2009. URL:
  3. K. Appel and W. Haken. Every planar map is four colorable. I. Discharging. Illinois J. Math., 21:429–490, 1977. Google Scholar
  4. K. Appel, W. Haken, and J. Koch. Every planar map is four colorable. II. Reducibility. Illinois J. Math., 21:491-567, 1977. Google Scholar
  5. W. D. Banks. Every natural number is the sum of forty-nine palindromes. INTEGERS - Electronic J. Combinat. Number Theory, 16, 2016. #A3. Google Scholar
  6. W. D. Banks and I. E. Shparlinski. Average value of the Euler function on binary palindromes. Bull. Pol. Acad. Sci. Math., 54:95-101, 2006. URL:
  7. William D. Banks and Igor E. Shparlinski. Prime divisors of palindromes. Periodica Mathematica Hungarica, 51(1):1-10, 2005. URL:
  8. J. Cilleruelo and F. Luca. Every positive integer is a sum of three palindromes. Preprint available at, 2016.
  9. J. Cilleruelo, F. Luca, and L. Baxter. Every positive integer is a sum of three palindromes. Math. Comp., 2017. URL:
  10. Patrick W. Dymond. Input-driven languages are in log n depth. Inf. Process. Lett., 26(5):247-250, 1988. URL:
  11. Yo-Sub Han and Kai Salomaa. Nondeterministic state complexity of nested word automata. Theor. Comput. Sci., 410(30-32):2961-2971, 2009. URL:
  12. G. H. Hardy and E. M. Wright. An Introduction to the Theory of Numbers. Oxford University Press, 5th edition, 1985. Google Scholar
  13. Matthias Heizmann, Daniel Dietsch, Marius Greitschus, Jan Leike, Betim Musa, Claus Schätzle, and Andreas Podelski. Ultimate automizer with two-track proofs - (competition contribution). In Marsha Chechik and Jean-François Raskin, editors, Tools and Algorithms for the Construction and Analysis of Systems - 22nd International Conference, TACAS 2016, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2016, Eindhoven, The Netherlands, April 2-8, 2016, Proceedings, volume 9636 of Lecture Notes in Computer Science, pages 950-953. Springer, 2016. URL:
  14. Matthias Heizmann, Jochen Hoenicke, and Andreas Podelski. Software model checking for people who love automata. In Natasha Sharygina and Helmut Veith, editors, Computer Aided Verification - 25th International Conference, CAV 2013, Saint Petersburg, Russia, July 13-19, 2013. Proceedings, volume 8044 of Lecture Notes in Computer Science, pages 36-52. Springer, 2013. URL:
  15. J. E. Hopcroft and J. D. Ullman. Introduction to Automata Theory, Languages, and Computation. Addison-Wesley, 1979. Google Scholar
  16. Salvatore La Torre, Margherita Napoli, and Mimmo Parente. On the membership problem for visibly pushdown languages. In Susanne Graf and Wenhui Zhang, editors, Automated Technology for Verification and Analysis, 4th International Symposium, ATVA 2006, Beijing, China, October 23-26, 2006., volume 4218 of Lecture Notes in Computer Science, pages 96-109. Springer, 2006. URL:
  17. P. Madhusudan, D. Nowotka, A. Rajasekaran, and J. Shallit. Lagrange’s theorem for binary squares. Preprint available at, 2017.
  18. Kurt Mehlhorn. Pebbling moutain ranges and its application of dcfl-recognition. In J. W. de Bakker and Jan van Leeuwen, editors, Automata, Languages and Programming, 7th Colloquium, Noordweijkerhout, The Netherland, July 14-18, 1980, Proceedings, volume 85 of Lecture Notes in Computer Science, pages 422-435. Springer, 1980. URL:
  19. M. B. Nathanson. Additive Number Theory: The Classical Bases. Springer-Verlag, 1996. Google Scholar
  20. William F. Ogden. A helpful result for proving inherent ambiguity. Mathematical Systems Theory, 2(3):191-194, 1968. URL:
  21. Alexander Okhotin and Kai Salomaa. State complexity of operations on input-driven pushdown automata. J. Comput. Syst. Sci., 86:207-228, 2017. URL:
  22. Xiaoxue Piao and Kai Salomaa. Operational state complexity of nested word automata. Theor. Comput. Sci., 410(35):3290-3302, 2009. URL:
  23. Kai Salomaa. Limitations of lower bound methods for deterministic nested word automata. Inf. Comput., 209(3):580-589, 2011. URL:
  24. T. N. Shorey. On the equation z^q = (xⁿ - 1)/(x - 1). Indag. Math., 48:345-351, 1986. URL:
  25. T. Tymoczko. The four-color problem and its philosophical significance. J. Philosophy, 76(2):57-83, 1979. Google Scholar
  26. R. C. Vaughan and T. Wooley. Waring’s problem: a survey. In M. A. Bennett, B. C. Berndt, N. Boston, H. G. Diamond, A. J. Hildebrand, and W. Philipp, editors, Number Theory for the Millennium. III, pages 301-340. A. K. Peters, 2002. Google Scholar
  27. Burchard von Braunmühl and Rutger Verbeek. Input-driven languages are recognized in log n space. In Marek Karpinski, editor, Fundamentals of Computation Theory, Proceedings of the 1983 International FCT-Conference, Borgholm, Sweden, August 21-27, 1983, volume 158 of Lecture Notes in Computer Science, pages 40-51. Springer, 1983. URL:
  28. S. Yates. The mystique of repunits. Math. Mag., 51:22-28, 1978. Google Scholar
Questions / Remarks / Feedback

Feedback for Dagstuhl Publishing

Thanks for your feedback!

Feedback submitted

Could not send message

Please try again later or send an E-mail