A098951 revision #14
|
|
A098951
|
|
Smallest available integer fitting the even/odd/even/odd/even... digit pattern (across adjacent numbers).
|
|
3
|
|
|
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, 83, 85, 87, 89, 210, 10, 12, 14, 16, 18, 30, 32, 34, 36, 38, 50, 52, 54, 56, 58, 70, 72, 74, 76, 78, 90, 92, 94, 96, 98, 101, 212, 103, 214, 105, 216, 107, 218, 109
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,3
|
|
COMMENTS
|
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
|
|
LINKS
|
|
|
MATHEMATICA
|
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 *)
(* 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 *)
|
|
CROSSREFS
|
|
|
KEYWORD
|
base,easy,nonn
|
|
AUTHOR
|
|
|
STATUS
|
proposed
|
|
|
|