login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A307129
Lexicographically earliest sequence of distinct terms such that the sequence of digits has alternating parity, and the same holds for the digits of the sequence a(n) + a(n+1).
2
1, 29, 21, 49, 23, 27, 25, 45, 47, 43, 258, 12, 18, 14, 16, 34, 36, 38, 32, 58, 123, 87, 214, 56, 125, 85, 216, 54, 127, 83, 218, 52, 129, 81, 2929, 89, 212, 78, 1014, 76, 1016, 74, 1018, 72, 1218, 1812, 1238, 1814, 1216, 1816, 1214, 1818, 1212, 1838, 1232, 1858, 1234, 1836, 1236, 1834, 1256, 3814, 1258, 1832, 1418, 1612, 1438, 1614, 1416, 1616, 1414, 1618, 1412, 1638, 1432, 1658, 1434, 1636, 1436, 1634, 1456, 3614, 1458, 1632, 3418, 1652, 3438, 1654, 3416, 1656, 3414, 1676, 3616, 1454, 3618, 1452, 3638, 1852, 3218, 1854
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
Cf. A307130 which is the associated sequence T.
See also: A097962, A098951.
Sequence in context: A033349 A088400 A040814 * A303615 A291492 A256441
KEYWORD
base,nonn
AUTHOR
Eric Angelini and Lars Blomberg, Mar 26 2019
EXTENSIONS
Edited by M. F. Hasler, Apr 08 2019
STATUS
approved