OFFSET
0,3
COMMENTS
When a(n) is a multiple of 10, then a(n+1) is the least number not occurring earlier. Therefore all nonnegative integers occur.
Numbers starting with and/or having only large digits occur late, typically after numbers ending in zero. This is the case for 1, 2, 3, 4, 5, 6, 7, 8 = a(104), 9 = a(114), ..., 90 = a(647), ..., 98 = a(729), 99 = a(732), ..., respectively preceded by 0, 10, 100, 110, 190, 180, 170, ..., 510, ..., 1310, 1410, ...
LINKS
M. F. Hasler, Table of n, a(n) for n = 0..999
E. Angelini, A sum visible in the 2d integer, SeqFan list, Feb. 3, 2016.
PROG
(PARI) A267760(n, flag=0, a=List(0), u=[])={ for(n=1, n, u=setunion(u, [a[n]]); if(a[n]==u[#u], bittest(flag, 1) && print1(a[n]", "); bittest(flag, 2) && print1(n-1", ")); if(a[n]==u[1]+1, bittest(flag, 3) && print1(a[n]", "); bittest(flag, 4) && print1(n-1, ", ")); while(#u>1&&u[2]==u[1]+1, u=u[^1]); for(k=u[1]+1, 9e9, setsearch(u, k) && next; d=digits(k); setsearch(Set(if(a[n]%10+d[1]<10, d, vector(#d-1, i, d[i+1]+d[i]*10))), a[n]%10+d[1]) && listput(a, k) && break)); if(bittest(flag, 0), Vec(a), a[n])} \\ flag may be the sum of any of the following: 1: return [a(0)..a(n)], 2: print records, 4: print indices of records, 8: print "late birds" A267771, 16: print indices of late birds.
CROSSREFS
KEYWORD
AUTHOR
Eric Angelini and M. F. Hasler, Feb 05 2016
STATUS
approved