OFFSET
1,2
EXAMPLE
a(1) = 1, k = 1, and the sum 1 is odd;
a(2) = 2, k = 2, and the sum 1 + 2 (= 3) is odd;
a(3) = 10, k = 1, and the sum 1 is odd;
a(4) = 4, k = 4, and the sum 2 + 1 + 0 + 4 (= 7) is odd;
a(5) = 3, k = 3, and the sum 0 + 4 + 3 (= 7) is odd;
a(6) = 5, k = 5, and the sum 1 + 0 + 4 + 3 + 5 (= 13) is odd; etc.
MATHEMATICA
a[1]=1; a[n_]:=a[n]=Block[{t=1}, While[(k=First@IntegerDigits@t; k>Length[s=Flatten[IntegerDigits/@Join[Array[a, n-1], {k}]]])||MemberQ[Array[a, n-1], t]||EvenQ@Total[s[[-k;; ]]], t++]; t]; Array[a, 79] (* Giorgos Kalogeropoulos, May 10 2022 *)
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Eric Angelini and Carole Dubois, May 30 2021
STATUS
approved