login
A182396
a(n) is the least number not occurring earlier such that neighboring digits sum to 1 or 10.
1
0, 1, 9, 10, 19, 101, 91, 910, 191, 919, 1010, 1019, 1910, 1919, 10101, 9101, 9191, 91010, 10191, 91019, 19101, 91910, 19191, 91919, 101010, 101019, 101910, 101919, 191010, 191019, 191910, 191919, 1010101, 910101, 910191, 919101, 919191
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
Sequence in context: A020694 A042095 A041164 * A041162 A041691 A300023
KEYWORD
nonn,base
AUTHOR
M. F. Hasler, Apr 27 2012
STATUS
approved