OFFSET
1,3
COMMENTS
Main diagonal of the square array A(n,k). Define D(x) to be the number of digits of x in base 10. A(1,1)= 1; Then A(n,n) = #{A(i,j) | D(A(i,j)) = D(A(n-1,n-1), 1 <= i,j <= n-1}. After the new diagonal A(n,n) is computed, populate the cells above and to the left of the new diagonal: A(i,n) = A(n,n) + n + 1 - i, 1 <= i < n (column); A(n,j) = A(1,n) + n + 1 - j, 1 <= j < n (row).
EXAMPLE
In the array below, A(5,5) = 10. Since it has two digits, we count the numbers in the array that have two digits up to that point. That would be 15. So A(6,6) = 15. Then we populate the 6th column up from the diagonal with 16, 17, 18, 19, 20. Then we populate the 6th row left from the diagonal with 21, 22, 23, 24, 25.
1, 2, 6, 12, 14, 20, 32, 46, 62, 80, ...
3, 1, 5, 11, 13, 19, 31, 45, 61, 79, ...
8, 7, 4, 10, 12, 18, 30, 44, 60, 78, ...
15, 14, 13, 9, 11, 17, 29, 43, 59, 77, ...
18, 17, 16, 15, 10, 16, 28, 42, 58, 76, ...
25, 24, 23, 22, 21, 15, 27, 41, 57, 75, ...
38, 37, 36, 35, 34, 33, 26, 40, 56, 74, ...
53, 52, 51, 50, 49, 48, 47, 39, 55, 73, ...
70, 69, 68, 67, 66, 65, 64, 63, 54, 72, ...
89, 88, 87, 86, 85, 84, 83, 82, 81, 71, ...
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Ali Sada, Nov 13 2019
STATUS
approved