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.

A167520 Positions of nonzero digits in this sequence, when all terms are concatenated.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76
Offset: 1

Views

Author

M. F. Hasler, Nov 05 2009

Keywords

Comments

Numbers are written in base 10 in the usual way; the terms give the positions of the nonzero digits when all terms are concatenated.
The sequence starts at index 1 since it is a list. The sequence cannot start with a(1)=0, this would mean that the first nonzero digit occurs at position 0, which does not make sense, or at best is a contradiction. Thus we cannot number the positions starting from zero, and the first digit (most significant digit of the first term) is necessarily nonzero, i.e. a(1)=1.

Examples

			The term which follows a(1)=1 (cf. comment) will be nonzero and thus have a nonzero most significant digit, which is the digit that comes right after the initial 1, thus digit # 2 is nonzero, therefore a(2)=2.
This goes on the like up to a(10)=10 (this refers to the most significant digit of the 10th term, which is necessarily nonzero). But the first digit of this "10" is followed by the digit '0', so the next nonzero digit is not at position 11, but it will come in the following position, a(11)=12.
From here on, there is always an increasing number of subsequent digits already written down, and it is sufficient to list the positions of the digits different from '0'.
		

Crossrefs

Cf. A167500 and A167502 (analog for base 2).

Programs

  • PARI
    base(n,b=10) = { local( a=[ n%b ]); while( 0= n & for( i=a[n-1]+1,#b, b[i] & (a=concat(a,i)) & break); #a