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.

A299865 The sum of the first n terms of the sequence is the concatenation of the first n digits of the sequence, and a(1) = 2.

Original entry on oeis.org

2, 20, 198, 1981, 19818, 198179, 1981783, 19817838, 198178379, 1981783783, 19817837830, 198178378308, 1981783783079, 19817837830783, 198178378307837, 1981783783078363, 19817837830783638, 198178378307836379, 1981783783078363783, 19817837830783637836, 198178378307836378362, 1981783783078363783612
Offset: 1

Views

Author

Eric Angelini and Jean-Marc Falcoz, Feb 21 2018

Keywords

Comments

The sequence starts with a(1) = 2 and is always extended with the smallest integer not yet present in the sequence and not leading to a contradiction.

Examples

			2 + 20 = 22 which is the concatenation of 2 and 2.
2 + 20 + 198 = 220 which is the concatenation of 2, 2 and 0.
2 + 20 + 198 + 1981 = 2201 which is the concatenation of 2, 2, 0 and 1.
		

Crossrefs

A300000 is the lexicographically first sequence of this type, with a(1) = 1.
Cf. A299866, ..., A299872 for variants with a(1) = 3, ..., 9.

Programs

  • PARI
    a(n,show=1,a=2,c=a,d=[c])={for(n=2,n,show&&print1(a",");a=-c+c=c*10+d[1];d=concat(d[^1],if(n>2,digits(a))));a} \\ M. F. Hasler, Feb 22 2018

Formula

a(n) = c(n) - c(n-1), where c(n) = concatenation of the first n digits, c(n) ~ 0.22*10^n, a(n) ~ 0.198*10^n. See A300000 for the proof. - M. F. Hasler, Feb 22 2018