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”).

A309540
a(n) is the smallest positive number not yet in the sequence that contains exactly one even digit and exactly one odd digit from a(n-1), and no digit in a(n) is repeated.
1
10, 102, 12, 21, 120, 103, 30, 130, 104, 14, 41, 124, 123, 23, 32, 132, 125, 25, 52, 152, 126, 16, 61, 106, 105, 50, 150, 107, 70, 170, 108, 18, 81, 128, 127, 27, 72, 172, 129, 29, 92, 192, 142, 134, 34, 43, 143, 140, 109, 90, 190, 160, 136, 36, 63, 163
OFFSET
1,1
LINKS
EXAMPLE
a(2)=102: a(2) is not 100 (since zero would be repeated), nor 101 (since 1 would be repeated).
MAPLE
filter:= proc(n) local L;
L:= convert(n, base, 10);
nops(L) = nops(convert(L, set)) and convert(L mod 2, set) = {0, 1};
end proc:
Cands:= select(filter, [$11 .. 1000]): nC:= nops(Cands):
R:= 10: r:= 10: r0, r1:= selectremove(type, convert(convert(r, base, 10), set), even):
for count from 1 do
found:= false;
for i from 1 to nC+1-count do
x:= Cands[i];
Lx:= convert(convert(x, base, 10), set);
if nops(Lx intersect r0) = 1 and nops(Lx intersect r1) = 1 then
found:= true;
R:= R, x;
r:= x;
Cands:= subsop(i=NULL, Cands);
r0, r1:= selectremove(type, convert(convert(r, base, 10), set), even);
break
fi
od;
if not found then break fi;
od:
R; # Robert Israel, Jan 09 2025
CROSSREFS
KEYWORD
nonn,base,fini,full,look,changed
AUTHOR
Enrique Navarrete, Aug 06 2019
EXTENSIONS
Edited by Robert Israel, Jan 10 2025
STATUS
approved