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.

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.

Original entry on oeis.org

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

Views

Author

Gavin Lupo, Apr 10 2023

Keywords

Comments

This sequence is A025581 without diagonal adjacent restriction.

Examples

			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
		

Crossrefs

Cf. A025581.

Programs

  • 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