cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A087061 Array A(n, k) = lunar sum n + k (n >= 0, k >= 0) read by antidiagonals.

This page as a plain text file.
%I A087061 #69 May 07 2023 11:06:33
%S A087061 0,1,1,2,1,2,3,2,2,3,4,3,2,3,4,5,4,3,3,4,5,6,5,4,3,4,5,6,7,6,5,4,4,5,
%T A087061 6,7,8,7,6,5,4,5,6,7,8,9,8,7,6,5,5,6,7,8,9,10,9,8,7,6,5,6,7,8,9,10,11,
%U A087061 11,9,8,7,6,6,7,8,9,11,11,12,11,12,9,8,7,6,7,8,9,12,11,12,13,12,12,13,9,8
%N A087061 Array A(n, k) = lunar sum n + k (n >= 0, k >= 0) read by antidiagonals.
%C A087061 There are no carries in lunar arithmetic. For each pair of lunar digits, to Add, take the lArger, but to Multiply, take the sMaller. For example:
%C A087061      169
%C A087061    + 248
%C A087061    ------
%C A087061      269
%C A087061 and
%C A087061        169
%C A087061      x 248
%C A087061      ------
%C A087061        168
%C A087061       144
%C A087061    + 122
%C A087061    --------
%C A087061      12468
%C A087061 Addition and multiplication are associative and commutative and multiplication distributes over addition. E.g., 357 * (169 + 248) = 357 * 269 = 23567 = 13567 + 23457 = (357 * 169) + (357 * 248). Note that 0 + x = x and 9*x = x for all x.
%C A087061 We have changed the name from "dismal arithmetic" to "lunar arithmetic" - the old name was too depressing. - _N. J. A. Sloane_, Aug 06 2014
%H A087061 Alois P. Heinz, <a href="/A087061/b087061.txt">Table of n, a(n) for n = 0..10010</a>
%H A087061 D. Applegate, <a href="/A087061/a087061.txt">C program for lunar arithmetic and number theory</a>
%H A087061 D. Applegate, M. LeBrun and N. J. A. Sloane, <a href="http://arxiv.org/abs/1107.1130">Dismal Arithmetic</a>, arXiv:1107.1130 [math.NT], 2011.
%H A087061 Brady Haran and N. J. A. Sloane, <a href="https://youtu.be/cZkGeR9CWbk">Primes on the Moon (Lunar Arithmetic)</a>, Numberphile video, Nov 2018.
%H A087061 Rémy Sigrist, <a href="/A087061/a087061.png">Colored representation of the array for n, k < 1000</a> (where the color is function of T(n, k))
%H A087061 <a href="/index/Di#dismal">Index entries for sequences related to dismal (or lunar) arithmetic</a>
%F A087061 T(n, k) = n - k if n - k > k, otherwise k, if seen as a triangle. See A004197, which is a kind of dual. In fact T(n, k) + A004197(n, k) = A003056(n, k). - _Peter Luschny_, May 07 2023
%e A087061 Lunar addition table A(n, k) begins:
%e A087061    [0] 0  1  2  3  4  5  6  7  8  9 10 11 12 13 ...
%e A087061    [1] 1  1  2  3  4  5  6  7  8  9 11 11 12 13 ...
%e A087061    [2] 2  2  2  3  4  5  6  7  8  9 12 12 12 13 ...
%e A087061    [3] 3  3  3  3  4  5  6  7  8  9 13 13 13 13 ...
%e A087061    [4] 4  4  4  4  4  5  6  7  8  9 14 14 14 14 ...
%e A087061    [5] 5  5  5  5  5  5  6  7  8  9 15 15 15 15 ...
%e A087061    [6] 6  6  6  6  6  6  6  7  8  9 16 16 16 16 ...
%e A087061    [7] 7  7  7  7  7  7  7  7  8  9 17 17 17 17 ...
%e A087061    [8] 8  8  8  8  8  8  8  8  8  9 18 18 18 18 ...
%e A087061    [9] 9  9  9  9  9  9  9  9  9  9 19 19 19 19 ...
%e A087061     ...
%e A087061 Seen as a triangle T(n, k):
%e A087061    [0] 0;
%e A087061    [1] 1, 1;
%e A087061    [2] 2, 1, 2;
%e A087061    [3] 3, 2, 2, 3;
%e A087061    [4] 4, 3, 2, 3, 4;
%e A087061    [5] 5, 4, 3, 3, 4, 5;
%e A087061    [6] 6, 5, 4, 3, 4, 5, 6;
%e A087061    [7] 7, 6, 5, 4, 4, 5, 6, 7;
%e A087061    [8] 8, 7, 6, 5, 4, 5, 6, 7, 8;
%e A087061    [9] 9, 8, 7, 6, 5, 5, 6, 7, 8, 9;
%p A087061 # Maple programs for lunar arithmetic are in A087062.
%p A087061 # Seen as a triangle:
%p A087061 T := (n, k) -> if n - k > k then n - k else k fi:
%p A087061 for n from 0 to 9 do seq(T(n, k), k = 0..n) od; # _Peter Luschny_, May 07 2023
%t A087061 ladd[x_, y_] := FromDigits[MapThread[Max, IntegerDigits[#, 10, Max @@ IntegerLength /@ {x, y}] & /@ {x, y}]]; Flatten[Table[ladd[k, n - k], {n, 0, 13}, {k, 0, n}]] (* _Davin Park_, Sep 29 2016 *)
%o A087061 (PARI) ladd=A087061(m,n)=fromdigits(vector(if(#(m=digits(m))>#n=digits(n),#n=Vec(n,-#m),#m<#n,#m=Vec(m,-#n),#n),k,max(m[k],n[k]))) \\  _M. F. Hasler_, Nov 12 2017, updated Nov 15 2018
%Y A087061 Cf. A087062 (multiplication), A087097 (primes), A004197, A003056.
%K A087061 nonn,tabl,nice,base,look
%O A087061 0,4
%A A087061 _Marc LeBrun_, Oct 09 2003
%E A087061 Edited by _M. F. Hasler_, Nov 12 2017