login
A344542
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).
1
1, 11, 3, 5, 13, 7, 9, 15, 17, 19, 21, 31, 33, 35, 37, 39, 41, 51, 53, 55, 57, 59, 61, 71, 73, 75, 77, 79, 81, 91, 93, 95, 97, 99, 101, 111, 113, 115, 117, 119, 121, 131, 133, 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
OFFSET
1,2
COMMENTS
No term ends with zero.
EXAMPLE
a(1) = 1, k = 1, and the product 1 is odd;
a(2) = 11, k = 1, and the product 1 is odd;
a(3) = 3, k = 3, and the product 1*1*3 (= 3) is odd;
a(4) = 5, k = 5, and the product 1*1*1*3*5 (= 15) is odd;
a(5) = 13, k = 3, and the product 5*1*3 (= 15) is odd;
a(6) = 7, k = 7, and the product 1*1*3*5*1*3*7 (= 315) is odd; etc.
MATHEMATICA
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 *)
CROSSREFS
Cf. A344539.
Sequence in context: A338716 A071234 A082626 * A334132 A245193 A338715
KEYWORD
base,nonn
AUTHOR
Eric Angelini and Carole Dubois, May 30 2021
STATUS
approved