A136562 Consider the triangle A136561: the n-th diagonal (from the right) is the sequence of (signed) differences between pairs of consecutive terms in the (n-1)th diagonal. The rightmost diagonal (A136562) is defined: A136562(1)=1; A136562(n) is the smallest integer > A136562(n-1) such that any (signed) integer occurs at most once in the triangle A136561.
1, 3, 9, 14, 26, 36, 63, 74, 103, 118, 149, 169, 210, 233, 280, 302, 357, 392, 464, 489, 553, 591, 673, 713, 796, 844, 941, 987, 1083, 1134, 1238, 1292, 1398, 1463, 1596, 1652, 1769, 1840, 1980, 2046, 2172, 2250, 2416, 2492, 2565, 2715, 2836, 3051, 3130, 3298
Offset: 1
Keywords
Examples
The triangle begins: 1, 2,3, 4,6,9, -5,-1,5,14, 13,8,7,12,26, -30,-17,-9,-2,10,36. Example: Considering the rightmost value of the 4th row: Writing a 10 here instead, the first 4 rows of the triangle become: 1 2,3 4,6,9 -9,-5,1,10 But 1 already occurs earlier in the triangle. So 10 is not the rightmost element of row 4. Checking 11,12,13,14; 14 is the smallest value that can be the rightmost element of row 4 and not have any elements of row 4 occur earlier in the triangle. So A136562(4) = 13.
Programs
-
Python
a, t = [1], [1] for n in range(1, 100): d = a[-1] while True: d += 1 row = [d] for j in range(n): row.append(row[-1]-t[-j-1]) if row[-1] in t: break else: a.append(d) t += reversed(row) break print(a) # t contains the triangle # [t[n*(n-1)/2] for n in range(1, 100)] gives leftmost column # Andrey Zabolotskiy, May 29 2017
Extensions
More terms from Andrey Zabolotskiy, May 29 2017
Comments