%I #15 May 11 2022 02:42:53
%S 1,2,3,4,5,6,7,8,9,12,13,14,15,16,17,18,19,22,23,24,25,26,27,28,29,32,
%T 33,34,35,36,37,38,39,42,43,44,45,46,47,48,49,52,53,54,55,56,57,58,59,
%U 62,63,64,65,66,67,68,69,72,73,74,75,76,77,78,79,82,83,84,85,86,87,88,89,92,93,94,95,96,97,98
%N Lexicographically earliest sequence S of distinct positive terms such that the product of the last k digits of S is even, k being the rightmost digit of a(n).
%C No term ends with zero.
%e a(7) = 7, k = 7, and the product 1*2*3*4*5*6*7 (= 5040) is even;
%e a(8) = 8, k = 8, and the product 1*2*3*4*5*6*7*8 (= 40320) is even;
%e a(9) = 9, k = 9, and the product 1*2*3*4*5*6*7*8*9 (= 362880) is even;
%e a(10) = 12, k = 2, and the product 1*2 (= 2) is even;
%e a(11) = 13, k = 3, and the product 1*2*3 (= 6) is even;
%e a(12) = 14, k = 4, and the product 1*2*3*4 (= 24) is even; 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]||OddQ[Times@@(s[[-k;;]])],t++];t];Array[a,80] (* _Giorgos Kalogeropoulos_, May 10 2022 *)
%Y Cf. A344542.
%K base,nonn
%O 1,2
%A _Eric Angelini_ and _Carole Dubois_, May 30 2021
|