OFFSET
1,2
COMMENTS
In the sequel we use S(n) = a(n) and T(n) = a(n) + a(n+1).
T is the sequence of the "first sums" of the successive pairs of S's adjacent terms. S(1) + S(2) = 1 + 29 = 30 and thus T(1) = 30; S(2) + S(3) = 29 + 21 = 50 and thus T(2) = 50; S(3) + S(4) = 21 + 49 = 70 and thus T(3) = 70; etc.
T has an entry for itself in the OEIS (A307130).
S and T need a lot of backtracking to be computed; this means that the last few terms of S and T might evolve. However, the first 100 terms proposed here seem correct.
It appears that the sequence can be computed in a greedy way, by discarding only the last term when it's impossible to find a successor for it. It also appears that the lexicographic earliest sequence following the same rules but starting with a(1) = 0 (or with a(1) = 2) is given, after this initial term, by the terms following S(11) = 258, i.e., a(2) = S(12) = 12, a(3) = S(13) = 18, etc. - M. F. Hasler, Apr 08 2019
EXAMPLE
The first terms of S are 1, 29, 21, 49, 23, 27, 25, 45, 47, 43, 258, ... and we see that the digits of S follow the pattern odd/even/odd/even...
The first terms of T are 30, 50, 70, 72, 50, 52, 70, 92, 90, 301, ... and we see that the digits of T follow the same odd/even/odd/even... pattern.
PROG
(PARI) okapi(N, a=1, U=[])={local(good(t)=if( t>T*98\99, T*=10; T*10\99+(t<11)*11, for(p=1, oo, t+=10^p; t\10^p%10>1 && return(t); t>=T&&break); (t+2*T*=10)\10), T, S, Sb, b=-1); while( N>#U=setunion(U, [a]), b!=a&& print1(a", "); my(t=1-a%2); T=10; while((t+=2)%10>1 ||99*a+99>t=good(t), if( !setsearch(U, t) && setsearch([[1], [2]], Set(digits(fromdigits(concat(S, digits(a+t)%2), 2), 4))), Sb=S; S=2-(a+t)%2; b=a; a=t; next(2))); print1("no: "); S=Sb; a=b; N++); a} \\ 2nd & 3rd (optional) arg allow to specify the initial value and forbid specific values. - M. F. Hasler, Apr 08 2019
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Eric Angelini and Lars Blomberg, Mar 26 2019
EXTENSIONS
Edited by M. F. Hasler, Apr 08 2019
STATUS
approved