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.

A327891 Square array A(n,k) (n, k >= 1) read by antidiagonals, where A(n,1) = n-1; A(n,k) is the number of occurrences of A(n,k-1) in the row up to k-1.

Original entry on oeis.org

0, 1, 1, 1, 1, 2, 2, 2, 1, 3, 1, 1, 1, 1, 4, 3, 3, 2, 1, 1, 5, 1, 1, 2, 2, 1, 1, 6, 4, 4, 3, 1, 2, 1, 1, 7, 1, 1, 1, 3, 1, 2, 1, 1, 8, 5, 5, 3, 2, 3, 1, 2, 1, 1, 9, 1, 1, 2, 2, 1, 3, 1, 2, 1, 1, 10, 6, 6, 4, 3, 4, 1, 3, 1, 2, 1, 1, 11, 1, 1, 1, 3, 2, 4, 1, 3, 1, 2, 1, 1
Offset: 1

Views

Author

Ali Sada, Oct 02 2019

Keywords

Comments

The terms of each row are quasi-periodic. Starting with n=3, the period starts at k=((n-1)^2)-1. The period is 2*(n-1) long, and we can find its terms with a simple mod function.
The second row is A158416.

Examples

			The square array begins:
  0, 1, 1, 2, 1, 3, 1, 4, 1, 5, 1, 6, 1, 7, 1, 8, ...
  1, 1, 2, 1, 3, 1, 4, 1, 5, 1, 6, 1, 7, 1, 8, 1, ...
  2, 1, 1, 2, 2, 3, 1, 3, 2, 4, 1, 4, 2, 5, 1, 5, ...
  3, 1, 1, 2, 1, 3, 2, 2, 3, 3, 4, 1, 4, 2, 4, 3, ...
  4, 1, 1, 2, 1, 3, 1, 4, 2, 2, 3, 2, 4, 3, 3, 4, ...
  5, 1, 1, 2, 1, 3, 1, 4, 1, 5, 2, 2, 3, 2, 4, 2, ...
  6, 1, 1, 2, 1, 3, 1, 4, 1, 5, 1, 6, 2, 2, 3, 2, ...
  7, 1, 1, 2, 1, 3, 1, 4, 1, 5, 1, 6, 1, 7, 2, 2, ...
  8, 1, 1, 2, 1, 3, 1, 4, 1, 5, 1, 6, 1, 7, 1, 8, ...
From _M. F. Hasler_, May 08 2025: (Start)
The quasi-periodic pattern that starts in row 3, column 3, is: (1 2 2 3), (1 3 2 4), ..., that is, (1 m-1 2 m), starting with m = 3, then m = 4, 5, 6, ...
The pattern that starts in row 4, column 8, is: (2 3 3 4 1 4), (2 4 3 5 1 5), ..., that is, (2 m-1 3 m 1 m), starting with m = 4, then m = 5, 6, 7, ...
The pattern that starts in row 5, column 15, is (3 m-1 4 m 1 m 2 m), starting with m = 5, then m = 6, 7, 8, ...
In row 6, from column 24 on, we have (4 m-1 5 m 1 m 2 m 3 m), with m = 6, 7, 8, ...
And so on: In row n, from column n(n-2) on, we have the pattern (n-2 m-1 n-1 m 1 ... n-3 m), starting with m = n. (End)
		

Crossrefs

The second row is A158416.

Programs

  • PARI
    M327891=Map(); apply( {A327891(n, k=0)= k|| [n+=(1-k=ceil(sqrt(8*n+1)/2-.5))*k\2, k+=1-n]; if(k==1, n-1, n>k\/2 || n<3, (k\/2)^(n==2==k%2), mapisdefined(M327891,[n,k], &n), n, mapput(M327891,[n,k], n=#[0| j<-[1..k-2], A327891(n, j)==A327891(n, k-1)]+1); n)}, [1..20]) \\ A327891 gives A(n,k) if k is given, otherwise a(n). The "quasi-periodic property" is not used.
    matrix(9,19,n,k, A327891(n, k)) \\ M. F. Hasler, May 08 2025

Formula

A(n, 1) = n-1; A(2, 2k-1) = k = A(n, 2k) if n = 1 or n > k; A(2, 2k) = 1 = A(n, 2k-1) if n = 1 or n > k. - M. F. Hasler, May 08 2025