[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
login
A362190
Triangle read by rows: T(n,k) is the smallest integer not already in the same row or column and also not diagonally adjacent to an equal integer.
1
0, 1, 2, 3, 0, 1, 2, 4, 3, 0, 5, 1, 2, 4, 3, 4, 3, 0, 1, 2, 5, 6, 5, 4, 3, 0, 1, 2, 7, 8, 6, 2, 4, 3, 0, 1, 9, 10, 5, 7, 1, 2, 4, 3, 0, 8, 6, 9, 10, 5, 0, 1, 2, 4, 3, 10, 7, 8, 6, 9, 4, 3, 0, 1, 2, 5, 11, 9, 10, 5, 7, 6, 8, 4, 3, 0, 1, 2
OFFSET
1,3
COMMENTS
This sequence is A025581 without diagonal adjacent restriction.
LINKS
EXAMPLE
Triangle begins:
n\k| 1 2 3 4 5 6 7 8 ...
---+----------------------------
1 | 0
2 | 1 2
3 | 3 0 1
4 | 2 4 3 0
5 | 5 1 2 4 3
6 | 4 3 0 1 2 5
7 | 6 5 4 3 0 1 2
8 | 7 8 6 2 4 3 0 1
PROG
(PARI) \\ here f(S) gives smallest not in set S.
f(S)={for(k=0, oo, if(!setsearch(S, k), return(k)))}
T(n)={my(M=matrix(n, n)); for(i=2, n, for(j=1, i, my(S=Set(concat([M[j..i-1, j]~, M[i, 1..j-1], M[i-1, max(1, j-1)], M[i-1, min(j+1, i-1)]]))); M[i, j]=f(S))); M}
{ my(A=T(10)); for(i=1, #A, print(A[i, 1..i])) } \\ Andrew Howroyd, Apr 10 2023
CROSSREFS
Cf. A025581.
Sequence in context: A279681 A053645 A212598 * A274650 A294648 A356784
KEYWORD
nonn,easy,tabl
AUTHOR
Gavin Lupo, Apr 10 2023
STATUS
approved