This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A098951 #22 Dec 09 2024 12:14:33 %S A098951 0,1,2,3,4,5,6,7,8,9,21,23,25,27,29,41,43,45,47,49,61,63,65,67,69,81, %T A098951 83,85,87,89,210,10,12,14,16,18,30,32,34,36,38,50,52,54,56,58,70,72, %U A098951 74,76,78,90,92,94,96,98,101,212,103,214,105,216,107,218,109 %N A098951 Smallest available integer fitting the even/odd/even/odd/even... digit pattern (across adjacent numbers). %C A098951 Different from A097962. %C A098951 Indeed, A097962 is required to be increasing. Therefore, a(31) = 210 can here be followed by a(32) = 10, while A097962(32) = 301. - _M. F. Hasler_, Mar 23 2019 %H A098951 T. D. Noe, <a href="/A098951/b098951.txt">Table of n, a(n) for n = 1..10000</a> %e A098951 After a(30) = 89, a(31) must start with an even digit. A number consisting of one even digit would work, but they are all in the sequence already. A 2-digit number with first digit even and second digit odd would work, but they are also all in the sequence already. A 3-digit number would have to have even, odd, and even digits in that order. The smallest such number is 210, so a(31) = 210. - _Michael B. Porter_, Mar 25 2019 %t A098951 altQ[n_] := n < 10 || Union[Total /@ Partition[ Mod[ IntegerDigits@n, 2], 2, 1]] == {1}; s = {0}; Do[j=1; While[ MemberQ[s, j] || EvenQ[s[[-1]] + First@ IntegerDigits@ j] || ! altQ[j], j++]; AppendTo[s, j], {68}]; s (* _Giovanni Resta_, Mar 05 2014 *) %t A098951 (* longer, but faster *) eoQ[n_] := Module[{d = IntegerDigits[n], alt, i}, alt = Table[If[OddQ[i], -1, 1], {i, d}]; i = 1; While[i++; i <= Length[d] && alt[[i]] == alt[[1]]*(-1)^(i + 1)]; If[i <= Length[d], alt[[1]] = 0]; alt[[1]]]; nn = 10000; tev = {}; tod = {}; Do[If[eoQ[i] == -1, AppendTo[tod, i], If[eoQ[i] == 1, AppendTo[tev, i]]], {i, nn}]; t = {0}; While[tev != {} && tod != {}, If[OddQ[t[[-1]]], AppendTo[t, tev[[1]]]; tev = Rest[tev], AppendTo[t, tod[[1]]]; tod = Rest[tod]]]; t (* _T. D. Noe_, Mar 05 2014 *) %Y A098951 Cf. A030141, A097962, A307129. %Y A098951 See also A377919. %K A098951 base,easy,nonn %O A098951 1,3 %A A098951 _Eric Angelini_, Oct 21 2004