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.

A330238 Triangle T(n,k): concatenate the absolute differences of the digits of n and k (the smaller one padded with leading zeros); n >= k >= 1.

This page as a plain text file.
%I A330238 #16 Dec 21 2024 18:00:50
%S A330238 0,1,0,2,1,0,3,2,1,0,4,3,2,1,0,5,4,3,2,1,0,6,5,4,3,2,1,0,7,6,5,4,3,2,
%T A330238 1,0,8,7,6,5,4,3,2,1,0,11,12,13,14,15,16,17,18,19,0,10,11,12,13,14,15,
%U A330238 16,17,18,1,0,11,10,11,12,13,14,15,16,17,2,1,0,12,11,10,11,12,13,14,15,16,3,2,1,0,13,12,11,10,11,12,13,14,15,4,3,2,1,0
%N A330238 Triangle T(n,k): concatenate the absolute differences of the digits of n and k (the smaller one padded with leading zeros); n >= k >= 1.
%C A330238 A digit-wise analog of A049581.
%C A330238 The binary operator T: N x N -> N is commutative, so we need only the lower half of the symmetric square table A330238 or A330240 (including n, k = 0). Also, 0 is the neutral element: T(x,0) = x for all x, therefore we omit row & column 0. The trivial diagonal T(x,x) = 0 could also be omitted but serves as an end-of-row marker and makes indexing simpler and more natural.
%H A330238 Eric Angelini, <a href="https://cinquantesignes.blogspot.com/2019/12/the-box-operation.html">The box ■ operation</a>, personal blog "Cinquante signes", and post to the SeqFan list, Dec 06 2019.
%H A330238 Eric Angelini, <a href="/A330237/a330237.pdf">The box ■ operation</a>, personal blog "Cinquante signes", and post to the SeqFan list, Dec 06 2019. [Cached copy]
%e A330238 The triangle starts as follows:
%e A330238     n | k=1  2   3   4   5   6   7   8   9  10  11
%e A330238    ---+-------------------------------------------
%e A330238     1 |  0,
%e A330238     2 |  1,  0,
%e A330238     3 |  2,  1,  0,
%e A330238     4 |  3,  2,  1,  0,
%e A330238     5 |  4,  3,  2,  1,  0,
%e A330238     6 |  5,  4,  3,  2,  1,  0,
%e A330238     7 |  6,  5,  4,  3,  2,  1,  0,
%e A330238     8 |  7,  6,  5,  4,  3,  2,  1,  0,
%e A330238     9 |  8,  7,  6,  5,  4,  3,  2,  1,  0,
%e A330238    10 | 11, 12, 13, 14, 15, 16, 17, 18, 19,  0,
%e A330238    11 | 10, 11, 12, 13, 14, 15, 16, 17, 18,  1,  0,
%e A330238    12 | 11, 10, 11, 12, 13, 14, 15, 16, 17,  2,  1,  0,
%e A330238     (...)
%o A330238 (PARI) A330238(n,k)=fromdigits(digits(n)-abs(Vec(digits(k),-logint(n,10)-1))) \\ see A330240 for a more general function not limited to 1 <= k <= n
%Y A330238 Cf. A330237 (same as a square array read by antidiagonals), A330240 (idem, including row & column 0), A049581 (T(n,k) = |n-k|).
%K A330238 nonn,base
%O A330238 1,4
%A A330238 _M. F. Hasler_, Dec 06 2019