TOPICS
Search

Lunar Arithmetic


Lunar arithmetic, also called dismal arithmetic, is a system of operations on nonnegative integers in a fixed base b, where b>=2 is an integer. Digit addition takes the maximum and digit multiplication takes the minimum. For larger numbers, addition combines corresponding digits, and multiplication combines shifted partial products without carries (Applegate et al. 2011, pp. 2 and 4-5).

Write x=sum_(i>=0)x_ib^i and y=sum_(i>=0)y_ib^i, padding the base-b expansions with leading zeros. The output digits are

(x direct sum _by)_k=max(x_k,y_k)
(1)
(x tensor _by)_k=max_(i+j=k)min(x_i,y_j),
(2)

where i,j,k>=0. These operations form a commutative semiring with additive identity element 0 and multiplicative identity b-1 (Applegate et al. 2011, pp. 5-7).

A lunar prime in base b is a number other than b-1 whose only factorizations under  tensor _b have a factor equal to b-1. In base 10, the first lunar primes are 19, 29, 39, 49, 59, 69, 79, 89, 90, 91, ... (OEIS A087097; Applegate et al. 2011, p. 7). Every lunar prime must contain the digit b-1, but this condition is not sufficient: 119=19 tensor _(10)19 (Applegate et al. 2011, p. 7).


See also

Semiring

Explore with Wolfram|Alpha

References

Applegate, D.; LeBrun, M.; and Sloane, N. J. A. "Dismal Arithmetic." J. Integer Seq. 14, 11.9.8, 2011. https://cs.uwaterloo.ca/journals/JIS/VOL14/Sloane/carry2.html.Numberphile. "Primes on the Moon (Lunar Arithmetic)." Nov. 7, 2018. https://www.youtube.com/watch?v=cZkGeR9CWbk.Sloane, N. J. A. Sequence A087097 in "The On-Line Encyclopedia of Integer Sequences."

Cite this as:

Weisstein, Eric W. "Lunar Arithmetic." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/LunarArithmetic.html

Subject classifications