Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #11 May 10 2022 09:55:29
%S 1,11,3,5,13,7,9,15,17,19,21,31,33,35,37,39,41,51,53,55,57,59,61,71,
%T 73,75,77,79,81,91,93,95,97,99,101,111,113,115,117,119,121,131,133,
%U 135,137,139,141,151,153,155,157,159,161,171,173,175,177,179,181,191,193,195,197,199,201,211,221,231,241,251
%N Lexicographically earliest sequence S of distinct positive terms such that the product of the last k digits of S is odd, k being the rightmost digit of a(n).
%C No term ends with zero.
%e a(1) = 1, k = 1, and the product 1 is odd;
%e a(2) = 11, k = 1, and the product 1 is odd;
%e a(3) = 3, k = 3, and the product 1*1*3 (= 3) is odd;
%e a(4) = 5, k = 5, and the product 1*1*1*3*5 (= 15) is odd;
%e a(5) = 13, k = 3, and the product 5*1*3 (= 15) is odd;
%e a(6) = 7, k = 7, and the product 1*1*3*5*1*3*7 (= 315) is odd; etc.
%t a[1]=1;a[n_]:=a[n]=Block[{t=1},While[(k=t~Mod~10;k>Length[s=Flatten[IntegerDigits/@Join[Array[a,n-1],{t}]]])||k<1||MemberQ[Array[a,n-1],t]||EvenQ[Times@@(s[[-k;;]])],t++];t];Array[a,70] (* _Giorgos Kalogeropoulos_, May 10 2022 *)
%Y Cf. A344539.
%K base,nonn
%O 1,2
%A _Eric Angelini_ and _Carole Dubois_, May 30 2021