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.

Showing 1-2 of 2 results.

A330240 Square array T(n,k): concatenate the absolute differences of the digits of n and k (the smaller one padded with leading zeros), read by antidiagonals, n, k >= 0.

Original entry on oeis.org

0, 1, 1, 2, 0, 2, 3, 1, 1, 3, 4, 2, 0, 2, 4, 5, 3, 1, 1, 3, 5, 6, 4, 2, 0, 2, 4, 6, 7, 5, 3, 1, 1, 3, 5, 7, 8, 6, 4, 2, 0, 2, 4, 6, 8, 9, 7, 5, 3, 1, 1, 3, 5, 7, 9, 10, 8, 6, 4, 2, 0, 2, 4, 6, 8, 10, 11, 11, 7, 5, 3, 1, 1, 3, 5, 7, 11, 11, 12, 10, 12, 6, 4, 2, 0, 2, 4, 6, 12, 10, 12, 13, 11, 11, 13, 5, 3, 1, 1, 3, 5, 13, 11, 11, 13, 14, 12, 10, 12, 14, 4, 2, 0, 2, 4, 14, 12, 10, 12, 14
Offset: 0

Views

Author

M. F. Hasler, Dec 06 2019

Keywords

Comments

A digit-wise analog of A049581. Referred to as "box" operation by Eric Angelini.
The binary operator T: N x N -> N is commutative, so this table is symmetric: it does not matter in which direction the antidiagonals are read, and it would be sufficient to specify only the lower half of the square table: see A330238 for this triangle. Zero is the neutral element: T(x,0) = x for all x. Any x is its own inverse or opposite x', as shown by the zero diagonal T(x,x) = 0.
A measure of non-associativity is the "commutator" ((x T y) T x') T y' = ((x T y) T x) T y which would be zero in the associative case, given that x = x' for all x. Here it turns out to be given by 2*A053616, read as a triangle, and rows extended quasi-periodically with period 10, see example.

Examples

			The square array starts as follows:
   n |k=0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 ...
  ---+-------------------------------------------------------------
   0 |  0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 ...
   1 |  1  0  1  2  3  4  5  6  7  8 11 10 11 12 13 14 15 16 17 ...
   2 |  2  1  0  1  2  3  4  5  6  7 12 11 10 11 12 13 14 15 16 ...
   3 |  3  2  1  0  1  2  3  4  5  6 13 12 11 10 11 12 13 14 15 ...
   4 |  4  3  2  1  0  1  2  3  4  5 14 13 12 11 10 11 12 13 14 ...
   5 |  5  4  3  2  1  0  1  2  3  4 15 14 13 12 11 10 11 12 13 ...
   6 |  6  5  4  3  2  1  0  1  2  3 16 15 14 13 12 11 10 11 12 ...
   7 |  7  6  5  4  3  2  1  0  1  2 17 16 15 14 13 12 11 10 11 ...
   8 |  8  7  6  5  4  3  2  1  0  1 18 17 16 15 14 13 12 11 10 ...
   9 |  9  8  7  6  5  4  3  2  1  0 19 18 17 16 15 14 13 12 11 ...
  10 | 10 11 12 13 14 15 16 17 18 19  0  1  2  3  4  5  6  7  8 ...
  11 | 11 10 11 12 13 14 15 16 17 18  1  0  1  2  3  4  5  6  7 ...
  12 | 12 11 10 11 12 13 14 15 16 17  2  1  0  1  2  3  4  5  6 ...
   (...)
It differs from A049581 only if at least one index is > 9.
The table of commutators Comm(n,k) := T(T(T(n,k),n),k) reads as follows:
   n |k=0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22...
  ---+---------------------------------------------------------------
   0 |  0 0 0 0 0 0 0 0 0 0  0  0  0  0  0  0  0  0  0  0  0  0  0...
   1 |  0 0 2 2 2 2 2 2 2 2  0  0  2  2  2  2  2  2  2  2  0  0  2...
   2 |  0 0 0 2 4 4 4 4 4 4  0  0  0  2  4  4  4  4  4  4  0  0  0...
   3 |  0 0 0 0 2 4 6 6 6 6  0  0  0  0  2  4  6  6  6  6  0  0  0...
   4 |  0 0 0 0 0 2 4 6 8 8  0  0  0  0  0  2  4  6  8  8  0  0  0...
   5 |  0 0 0 0 0 0 2 4 6 8  0  0  0  0  0  0  2  4  6  8  0  0  0...
   6 |  0 0 0 0 0 0 0 2 4 6  0  0  0  0  0  0  0  2  4  6  0  0  0...
   7 |  0 0 0 0 0 0 0 0 2 4  0  0  0  0  0  0  0  0  2  4  0  0  0...
   8 |  0 0 0 0 0 0 0 0 0 2  0  0  0  0  0  0  0  0  0  2  0  0  0...
   9 |  0 0 0 0 0 0 0 0 0 0  0  0  0  0  0  0  0  0  0  0  0  0  0...
  10 |  0 0 0 0 0 0 0 0 0 0  0  0  0  0  0  0  0  0  0  0 20 20 20...
  11 |  0 0 2 2 2 2 2 2 2 2  0  0  2  2  2  2  2  2  2  2 20 20 22...
  12 |  0 0 0 2 4 4 4 4 4 4  0  0  0  2  4  4  4  4  4  4 20 20 20...
   (...)
Up to row & column 10, the columns are twice the sequence A053616 written as triangle. The first 10 X 10 block repeats horizontally and vertically. Further away from the origin, the elements of this block multiplied by corresponding powers of 10 are added to the corresponding 10 X 10 blocks: e.g., the block Comm(130..139,270..279) = Comm(0..9,0..9) + 260, where 260 = 100*Comm(1,2) + 10*Comm(3,7).
		

Crossrefs

Cf. A330238 (variant excluding row & column 0), A330237 (lower left triangle), A049581 (T(n,k) = |n-k|).

Programs

  • PARI
    A330240(a,b)=fromdigits(abs(Vec(digits(min(a,b)),if(a+b,-logint(a=max(a,b),10)-1))-digits(a)))

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.

Original entry on oeis.org

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, 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, 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
Offset: 1

Views

Author

M. F. Hasler, Dec 06 2019

Keywords

Comments

A digit-wise analog of A049581.
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.

Examples

			The triangle starts as follows:
    n | k=1  2   3   4   5   6   7   8   9  10  11
   ---+-------------------------------------------
    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,  1,  0,
    8 |  7,  6,  5,  4,  3,  2,  1,  0,
    9 |  8,  7,  6,  5,  4,  3,  2,  1,  0,
   10 | 11, 12, 13, 14, 15, 16, 17, 18, 19,  0,
   11 | 10, 11, 12, 13, 14, 15, 16, 17, 18,  1,  0,
   12 | 11, 10, 11, 12, 13, 14, 15, 16, 17,  2,  1,  0,
    (...)
		

Crossrefs

Cf. A330237 (same as a square array read by antidiagonals), A330240 (idem, including row & column 0), A049581 (T(n,k) = |n-k|).

Programs

  • 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
Showing 1-2 of 2 results.