OFFSET
1,6
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.
EXAMPLE
Table 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, ...
PROG
(VBA/Excel)
Sub A327891()
For m = 2 To 40
For i = 2 To 40
Cells(m, 1) = m - 2
Cells(m, 2) = 1
k = Cells(m, i)
For j = i - 1 To 1 Step -1
If k = Cells(m, j) Then
Cells(m, i + 1) = 1 + Cells(m, j + 1)
Exit For
Else
Cells(m, i + 1) = 1
End If
Next j
Next i
Next m
S = 1
For m = 3 To 40
For k = m - 2 To 1 Step -1
n = m - k
Cells(1, S) = Cells(n, k)
S = S + 1
Next k
Next m
End Sub
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Ali Sada, Oct 02 2019
STATUS
approved