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.

A330656 Square array read by antidiagonals downwards (see Comments lines for definition).

Original entry on oeis.org

0, 1, -1, 3, 2, -3, 5, -2, 4, -7, 11, -6, -4, 8, -15, 17, 6, -12, -8, 16, -31, 26, -9, 15, -27, -19, 35, -66, 7, 19, -28, 43, -70, -51, -86, -20, 12, -5, 24, -52, -95, -25, -26, -60, -40, 21, 9, -14, -38, 14, -109, -84, 58, -118, -78, 10, -11, 20, 34, -72, 86, -195, -111, -169, 51, -129, 23, 13, -24, -44, 78, -150
Offset: 1

Views

Author

Eric Angelini and Carole Dubois, Apr 27 2020

Keywords

Comments

Consider the square array in the Example section.
From the second row on, every term t in the array is the difference between the two integers a and b above it (a is the one immediately above t and b is the one to the right of a). There are two ways to compute this term t: t = a - b or t = b - a. Here we always try first to compute t as "the smallest term minus the biggest term". If this operation produces at some point in the antidiagonal a term already present in the array, we stop to compute the successive differences and try instead "the biggest term minus the smallest term". If this operation fails too (we obtain at some point a term already in the array), we have to prolong the first row with another term k, this term being always the smallest available one not present in the array and not leading to a contradiction at any stage in the antidiagonal that k towers.

Examples

			The upper-left corner of the array starts like this:
     0    1    3    5   11   17   26    7   12   21   10   23...
    -1    2   -2   -6    6   -9   19   -5    9  -11   13  -16...
    -3    4   -4  -12   15  -28   24  -14   20  -24   29  -34...
    -7    8   -8  -27   43  -52  -38   34  -44   53  -63   82...
   -15   16  -19  -70  -95   14  -72   78  -97  116 -145 -192...
   -31   35  -51  -25 -109   86 -150 -175 -213  261  -47 -171...
   -66  -86  -26  -84 -195 -236   25   38 -474 -308 -124  117...
   -20  -60   58 -111  -41 -261  -13 -512 -166 -184 -241 -339...
   -40 -118 -169   70 -220 -248 -499 -346  -18  -57   98 -361...
   -78   51 -239  290   28 -251 -153 -328  -39 -155 -459  475...
  -129 -290 -529 -262 -279  -98  175 -289 -116 -304 -934 -160...
  -161  239 -267  -17 -181 -273 -464 -173  188 -630 -774 -364...
...
The first row starts with 0. We prolong it with the smallest unused positive integer so far. This is 1:
  0   1
We compute immediately 0 - 1 = -1 to fill the first antidiagonal and get:
  0    1
    -1
We cannot prolong the first row with 2 as this 2 would produce a contradiction for c:
  0    1     2
    -1    c
Indeed, either 1 - 2 or 2 - 1 would lead to c = -1 or +1, both results being already in the array. We then try to prolong the first row with the next smallest available integer not yet in the array, which is 3:
  0    1     3
    -1    c
To compute c, we try first "smallest term minus biggest one":
  0    1     3
    -1   -2
       d
But the result -2 result will lead to a term d being either -1 or +1, which are both already in the array; we then try, at the upper level, "biggest term minus smallest term" (this is 3 minus 1 = 2), which produces now a new term c = 3 - 1 and a new hope to compute a term d fitting the array:
  0    1     3
    -1    2
       d
Indeed, the operation "smallest term minus biggest one" works now to find d as -1 minus 2 is -3, a term not yet in the array:
  0     1    3
    -1    2
       -3
As the last antidiagonal is completed, we try to complete a new one with k, l, m and n, with k, l, m, n not being already in the array:
  0    1    3     k
    -1   +2    l
      -3     m
          n
etc.
		

References

  • Eric Angelini on Math-Fun mailing list, March 31 2020.

Crossrefs

Cf. A330903 where a similar idea is developed, but with positive terms only on the first row. A327743 [a(n) = smallest positive number not already in the sequence such that for each k = 1, ..., n-1, the k-th differences are distinct].

A338161 Successive sums of successive terms produce the successive natural numbers (see the Comments section).

Original entry on oeis.org

1, -2, 4, -3, -5, 11, -6, -7, 8, 9, 10, 12, 13, -14, -16, -15, -17, 18, 19, -20, 21, 22, 23, 24, 25, -26, -27, -34, -28, -29, -30, 31, 32, 33, 35, -36, 37, 38, 39, 40, 41, -42, -43, -44, -57, -45, -46, -47, 48, 49, -50, 51, 52, 53, -55, 54, 56, 58, 59, 60, 61, -62, -63, -64, -65, -83, -66, -67, -68, -69, 70, 71
Offset: 1

Views

Author

Eric Angelini and Carole Dubois, Oct 14 2020

Keywords

Comments

The 1st term sums up to 1;
the next 2 terms sum up to 2;
the next 3 terms sum up to 3;
the next 4 terms sum up to 4;
... the next k terms sum up to k.

Examples

			1 = 1 (1 term);
2 = - 2 + 4 (2 terms);
3 = - 3 - 5 + 11 (3 terms);
4 = - 6 - 7 + 8 + 9 (4 terms);
5 = 10 + 12 + 13 - 14 - 16 (5 terms);
6 = - 15 - 17 + 18 + 19 - 20 + 21 (6 terms); etc.
How are the plus and minus signs split between the terms to get the above six equations? Here is the method -- with an example:
1) no absolute value of any term can be present twice or more in the sequence;
2) to start a new equation, always use the set of smallest absolute values not yet used; say, for the above 5-term equation, that they are a, b, c, d and e;
3) the set of unused values for a, b, c, d and e is here 10, 12, 13, 14, 15;
4) try all the possible mix of values and signs to find one or more solutions (the try 5 = 10 + 12 - 13 - 14 + 15, for instance, doesn't work as we would get 5 = 10);
5) if no such mix leads to a solution (which is the case here), add 1 to the biggest integer of the values' set and try again;
6) the above set would then become 10, 12, 13, 14, 16 -- and a quick computer search gives the solution 5 = 10 + 12 + 13 - 14 - 16;
7) had we found more than one solution, we would have kept the lexicographically earliest one (-10 comes before +10);
8) if a new mix doesn't lead to a solution, add again 1 to the biggest integer of the values' set and try again; etc.
		

Crossrefs

Cf. A330903.

Programs

  • Python
    # see Link section
Showing 1-2 of 2 results.