OFFSET
1,2
COMMENTS
In an n-row subtractive triangle, there are n-i+1 integers in the i-th row. The integers in the first row are arbitrary. From the next row, the integers are the absolute difference between adjacent integers in the previous row.
LINKS
International Mathematical Olympiad, Problem 3 of IMO 2018.
Denis Cazor, Algorithme en Français
Denis Cazor, Algorithm in English
EXAMPLE
a(6)=22 because there is a 6-row subtractive triangle with distinct integers in [1..22] as follows:
1: 6 20 22 3 21 13
2: 14 2 19 18 8
3: 12 17 1 10
4: 5 16 9
5: 11 7
6: 4
However, there is no such triangle with distinct integers in [1..21].
CROSSREFS
KEYWORD
nonn,hard,more
AUTHOR
Yi Yang, Jun 01 2013
EXTENSIONS
a(12) from Yi Yang, Mar 04 2015
a(13) from Denis Cazor, Aug 01 2022
STATUS
approved