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.

A273619 Table read by antidiagonals (n>1, k>0): A(n,k) = leading digit of k in base n.

Original entry on oeis.org

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

Views

Author

Andrey Zabolotskiy, May 30 2016

Keywords

Comments

This is a generalization of A000030.
The first occurrence of a number k in the sequence is given by A(k+1,k).

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.
		

Crossrefs

Cf. A000030 (row 10), A122586 (row 3), A122587 (row 4).
Cf. A051777, A051778 (may be interpreted as arrays of last digits of k in base n).

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)