OFFSET
1,2
COMMENTS
The top of the hereunder triangle has value 1, so a(1) = 1. The next values are assigned alternately to the left border (2), then the right border (3), then the left border of the next row (4), then the right border (6), then the left border of the next row (7), then the right border (8), etc.
To build the triangle, always start a new row from the left with the smallest integer not yet present that doesn't produce an existing term. Indeed, this integer immediately generates a right-descending diagonal of terms (that are the sum of the two existing integers above it). We must then check at every stage if no duplicate term appears.
The end of the row is similarly filled with the smallest integer not yet present that doesn't produce a contradiction in its left-descending diagonal.
This is for instance the situation of the computed "diamond" after the value 12 has been assigned (on the right):
1
2 3
4 5 6
7 9 11 8
10 16 20 19 12
26 36 39 31
62 75 70
137 145
282
This "diamond" has 9 rows that won't change -- but the triangle has only 5 completed rows (the 5th row starts with 10 and ends with 12). To fully compute the 6th row of the triangle, we will try to expand the diamond with the smallest available integer -- which is 13. But 13 fails -- as we will see hereunder that the right-descending diagonal of 13 immediately produces a forbidden 39 (this 39 being used already in the triangle as the sum of 20 and 19):
1
2 3
4 5 6
7 9 11 8
10 16 20 19 12
13 26 36 39 31
39 62 75 70
137 145
282
So, as 13 fails, we will try 14 instead:
1
2 3
4 5 6
7 9 11 8
10 16 20 19 12
14 26 36 39 31
40 62 75 70
102 137 145
239 282
521
No contradiction appears with 14, all the terms of the diamond are distinct -- we then try to assign 13 at the end of the row starting with 14, and we check if its left-descending diagonal doesn't produce any duplicate term in the triangle:
1
2 3
4 5 6
7 9 11 8
10 16 20 19 12
14 26 36 39 31 13
40 62 75 70 44
102 137 145 114
239 282 259
521 541
1062
This is fine; the 6th row of the triangle is now completed.
Etc.
LINKS
Lars Blomberg, Table of n, a(n) for n = 1..200
EXAMPLE
The triangle starts like this:
1
2 3
4 5 6
7 9 11 8
10 16 20 19 12
14 26 36 39 31 13
15 40 62 75 70 44 17
18 55 102 137 145 114 61 21
22 73 157 239 282 259 175 82 23
...
CROSSREFS
KEYWORD
AUTHOR
Eric Angelini and Lars Blomberg, Oct 06 2018
STATUS
approved