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.

This page as a plain text file.
%I A319154 #44 Jan 05 2020 00:40:14
%S A319154 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,
%T A319154 15,51,16,61,17,71,18,81,19,91,100,22,23,32,24,42,25,52,26,62,27,72,
%U A319154 28,82,29,92,200,33,34,43,35,53,36,63,37,73,38,83,39,93,300,44,45,54
%N 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.
%C A319154 Theorem: Every nonnegative number appears.
%C A319154 Proof: (Sketched by _Enrique Navarrete_, Sep 25 2018; completed by _N. J. A. Sloane_, Oct 27 2018)
%C A319154 (i) Sequence is infinite (dG, G=giant number, is always available)
%C A319154 (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.
%C A319154 (iii) Some final digit (d, say) appears infinitely often. (Otherwise sequence would be finite.) If d=0, go to step (vi).
%C A319154 (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.)
%C A319154 (v) In particular, all numbers dm0 appear.
%C A319154 (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
%H A319154 Rémy Sigrist, <a href="/A319154/b319154.txt">Table of n, a(n) for n = 1..10000</a>
%e A319154 a(2) = 1 since it is formed from a(1) = 0 as 01 = 1.
%e A319154 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.
%t A319154 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 *)
%o A319154 (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)););}
%o A319154 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
%Y A319154 Cf. A008592, A162501, A173237, A261370.
%K A319154 nonn,base,look,hear
%O A319154 1,3
%A A319154 _Enrique Navarrete_, Sep 25 2018