Arithmetic and Boolean Operations on Recursively Run-Length Compressed Natural Numbers

We study arithmetic properties of a new tree-based canonical number representation, recursively run-length compressed natural numbers, defined by applying recursively a run-length encoding of their binary digits. We design arithmetic and boolean operations with recursively runlength compressed natural numbers that work a block of digits at a time and are limited only by the representation complexity of their operands, rather than their bitsizes. As a result, operations on very large numbers exhibiting a regular structure become tractable. In addition, we ensure that the average complexity of our operations is still within constant factors of the usual arithmetic operations on binary numbers. Arithmetic operations on our recursively run-length compressed are specified as pattern-directed recursive equations made executable by using a purely declarative subset of the functional language Haskell.

[1]  Jens Liebehenschel,et al.  Ranking and unranking of a generalized Dyck language and the application to the generation of random trees. , 1999 .

[2]  Paul Tarau,et al.  Boolean Evaluation with a Pairing and Unpairing Function , 2012, 2012 14th International Symposium on Symbolic and Numeric Algorithms for Scientific Computing.

[3]  Jean Vuillemin,et al.  Efficient Data Structure and Algorithms for Sparse Integers, Sets and Predicates , 2009, 2009 19th IEEE Symposium on Computer Arithmetic.

[4]  Max Jeger The Isomorphism Problem for Catalan Families , 1995 .

[5]  R.K. Guy,et al.  On numbers and games , 1978, Proceedings of the IEEE.

[6]  D E Knuth,et al.  Mathematics and Computer Science: Coping with Finiteness , 1976, Science.

[7]  J. W. Bruce,et al.  A Really Trivial Proof of the Lucas-Lehmer Test , 1993 .

[8]  Conrado Martínez,et al.  Generic Algorithms for the Generation of Combinatorial Objects , 2003, MFCS.

[9]  Donald L. Kreher,et al.  Combinatorial algorithms: generation, enumeration, and search , 1998, SIGA.

[10]  Paul Tarau,et al.  Arithmetic algorithms for hereditarily binary natural numbers , 2013, SAC.

[11]  Paul Tarau,et al.  On computing with types , 2012, SAC '12.

[12]  William E. Byrd,et al.  Pure, Declarative, and Constructive Arithmetic Relations (Declarative Pearl) , 2008, FLOPS.

[13]  Paul Tarau The Arithmetic of Recursively Run-Length Compressed Natural Numbers , 2014, ICTAC.

[14]  Charalambos A. Charalambides,et al.  Enumerative combinatorics , 2018, SIGA.

[15]  Ming Li,et al.  An Introduction to Kolmogorov Complexity and Its Applications , 2019, Texts in Computer Science.

[16]  Paul Tarau,et al.  Computing with Catalan Families , 2014, LATA.

[17]  Paul Tarau,et al.  Declarative modeling of finite mathematics , 2010, PPDP.

[18]  R. L. Goodstein,et al.  On the restricted ordinal theorem , 1944, Journal of Symbolic Logic.

[19]  Peter C. Chapin Formal languages I , 1973, CSC '73.