OFFSET
0,3
COMMENTS
"Number" means "nonnegative integer", or "positive integer", starting at a(1)=1.
Starting with 0 or 1, the sequence contains only the digits {0,1,9}. Starting the sequence with another digit > 1 seems to lead to a sequence alternating this initial digit and (10 minus that digit): E.g., 2,8,28,282,82,828,... or 5,55,555,5555,55555,....
Consider the function "sad" (for "sum of adjacent digits") which maps any set S and initial term x to the sequence a = sad(S,x) defined by a(0)=x, a(n+1) = the least positive integer not occurring earlier such that the sum of any two adjacent digits is in S. Then, if max(S) < 10, the sequence will be finite, ending with the first term which ends with the digit max(S) (or with x for S={}). If S={s} with 9<s<19, then the sequence cannot start with 0; if it starts with s-10 < d < 10, then the sequence consists of alternating digits d,s-d,d*10+s-d,... (see the above examples with s=10, d=5 and d=2). In this sense, the present sequence A182396=sad({1,10},0) is the "least nontrivial" sequence of this class.
PROG
(PARI) {A182396_list(N=20/*number of terms to compute*/, S=[1, 10]/*allowed digit sums*/, a=[0]/*initial terms*/, v/*=1 to print terms as they are computed*/)= my( L=a[#a], u=sum(i=1, #a, 1<<a[i]), isok(a, M)= a[1]=Str(a[1]); for(i=2, #a=Vecsmall(concat(a)), bittest( M, a[i-1]+a[i]-96) || return); 1); S=sum(i=1, #S, 1<<S[i]); for( n=1, N, v & print1(L", "); for( t=1, 9e9, bittest(u, t) & next; isok([ L, t ], S ) || next; a=concat(a, L=t); u+=1<<t; break)); a}
CROSSREFS
KEYWORD
nonn,base
AUTHOR
M. F. Hasler, Apr 27 2012
STATUS
approved