A273619 Table read by antidiagonals (n>1, k>0): A(n,k) = leading digit of k in base n.
1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 2, 3, 1, 1, 1, 2, 3, 1, 1, 1, 1, 2, 3, 4, 1, 2, 1, 1, 2, 3, 4, 1, 1, 2, 1, 1, 2, 3, 4, 5, 1, 1, 2, 1, 1, 2, 3, 4, 5, 1, 1, 2, 1, 1, 1, 2, 3, 4, 5, 6, 1, 1, 2, 1, 1, 1, 2, 3, 4, 5, 6, 1, 1, 1, 2, 1, 1, 1, 2, 3, 4, 5, 6, 7, 1
Offset: 2
Examples
First few rows of the array are: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1... 1, 2, 1, 1, 1, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2... 1, 2, 3, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 1, 1, 1... 1, 2, 3, 4, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3... 1, 2, 3, 4, 5, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3... 1, 2, 3, 4, 5, 6, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2... 1, 2, 3, 4, 5, 6, 7, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2... Note that the initial row is row 2. A(3,3) corresponds to row n=3 and column k=3, and k=3 is written as 10 in base n=3, and the leading digit of 10 is 1, so A(3,3)=1. A(12,11) corresponds to row n=12 and column k=11, and 11 is written as B in base 12, and the leading and only digit of B is B which is number 11 in decimal, so A(12,11)=11.
Links
- Robert Israel, Table of n, a(n) for n = 2..10012 (first 142 antidiagonals, flattened)
Crossrefs
Programs
-
Maple
A:= (n,k) -> floor(k/n^floor(log[n](k))): seq(seq(A(n-k,k),k=1..n-2),n=2..20); # Robert Israel, May 31 2016
-
Mathematica
a[n_, k_] := First[IntegerDigits[k, n]];
-
PARI
T(n,k) = digits(k, n)[1]; tabl(10, 10, n, k, n++; T(n,k)); \\ Michel Marcus, Jun 12 2016
Formula
From Robert Israel, May 31 2016: (Start)
A(n,k) = floor(k/n^floor(log_n(k))).
A(n,k) = k if n > k.
A(n,k) = A(n, floor(k/n)) otherwise.
G.f. of row n, G_n(x), satisfies G_n(x) = (1-x^n)/(1-x)^2 - (1+(n-1)*x^n)/(1-x) + (1-x^n)*G_n(x^n)/(1-x). (End)
Comments