|
|
A344544
|
|
Lexicographically earliest sequence S of distinct positive terms such that the sum of the last k digits of S is odd, k being the leftmost digit of a(n).
|
|
0
|
|
|
1, 2, 10, 4, 3, 5, 6, 8, 7, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 30, 40, 31, 21, 22, 32, 41, 23, 24, 33, 25, 26, 34, 42, 35, 27, 28, 36, 43, 29, 50, 51, 37, 38, 80, 39, 52, 60, 81, 44, 45, 46, 47, 48, 49, 70, 53, 71, 54, 82, 100, 61, 72, 55, 73, 56, 83, 57, 62, 58, 90, 59, 63, 64, 84, 65, 66, 67, 74
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
LINKS
|
|
|
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
|
|
|
STATUS
|
approved
|
|
|
|