OFFSET
2,2
LINKS
FORMULA
If k <= n, A(n, k) = k.
EXAMPLE
| n\k | 1 2 3 4 5 6 7 8 9 10 11 12 13 ...
|-----|-----------------------------------------------------------
| 2 | 1, 2, 1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 2, ...
| 3 | 1, 2, 3, 1, 2, 1, 2, 1, 2, 1, 2, 3, 1, ...
| 4 | 1, 2, 3, 4, 1, 2, 3, 1, 2, 3, 1, 2, 3, ...
| 5 | 1, 2, 3, 4, 5, 1, 2, 3, 4, 1, 2, 3, 4, ...
| 6 | 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 1, 2, ...
| 7 | 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, ...
| 8 | 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, ...
| ... |
PROG
(PARI) row(n, k) = my(v=vector(n, i, i), w); while(#v<k, w=vector(#v-1, i, v[i]); for(y=1, v[#v], v=concat(v, w))); vector(k, i, v[i])
first(n, k) = my(v, m=matrix(0, k)); for(x=1, n, v=row(x+1, k); m=concat(m, v)); m
CROSSREFS
AUTHOR
Iain Fox, Dec 07 2018
STATUS
approved