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.

A319154 a(n) is the smallest nonnegative integer not yet in the sequence that starts with the ending digit of a(n-1); a(1)=0; initial zeros are dropped.

Original entry on oeis.org

0, 1, 10, 2, 20, 3, 30, 4, 40, 5, 50, 6, 60, 7, 70, 8, 80, 9, 90, 11, 12, 21, 13, 31, 14, 41, 15, 51, 16, 61, 17, 71, 18, 81, 19, 91, 100, 22, 23, 32, 24, 42, 25, 52, 26, 62, 27, 72, 28, 82, 29, 92, 200, 33, 34, 43, 35, 53, 36, 63, 37, 73, 38, 83, 39, 93, 300, 44, 45, 54
Offset: 1

Views

Author

Enrique Navarrete, Sep 25 2018

Keywords

Comments

Theorem: Every nonnegative number appears.
Proof: (Sketched by Enrique Navarrete, Sep 25 2018; completed by N. J. A. Sloane, Oct 27 2018)
(i) Sequence is infinite (dG, G=giant number, is always available)
(ii) As usual for these "lexicographically earliest distinct term sequences", for any k, there is a threshold n_k such that for all n > n_k, a(n) > k.
(iii) Some final digit (d, say) appears infinitely often. (Otherwise sequence would be finite.) If d=0, go to step (vi).
(iv) All numbers beginning with d appear (If dm were missing, find xd in sequence which is > dm and also > n_{dm}. Then term after xd would be dm, contradiction.)
(v) In particular, all numbers dm0 appear.
(vi) After a number ending in 0, the next number is the smallest missing number. So if x is missing, find dm0 > n_x, then the next term would be (0)x = x, a contradiction. QED

Examples

			a(2) = 1 since it is formed from a(1) = 0 as 01 = 1.
a(20) = 11 since it is the smallest number not yet in the sequence that starts with the ending digit 0 of a(19) = 90.
		

Crossrefs

Programs

  • Mathematica
    Nest[Append[#, Block[{k = 1}, While[Nand[FreeQ[#, k], If[# == 0, True, First@ IntegerDigits@ k == #] &@ Mod[#[[-1]], 10]], k++]; k]] &, {0}, 69] (* Michael De Vlieger, Oct 15 2018 *)
  • PARI
    nexta(v, x) = {my(d = x % 10, newa); for (i=0, oo, newa = eval(concat(Str(d), Str(i))); if (! vecsearch(v, newa), return (newa)););}
    lista(nn) = {lasta = 0; print1(lasta, ", "); va = [lasta]; for (n=1, nn, newa = nexta(va, lasta); print1(newa, ", "); va = vecsort(concat(va, newa)); lasta = newa;);} \\ Michel Marcus, Oct 15 2018