%I #13 May 11 2022 17:32:27
%S 1,2,4,6,8,20,22,24,26,28,40,42,44,46,48,60,62,64,66,68,80,82,84,86,
%T 88,110,112,114,116,118,130,132,134,136,138,150,152,154,156,158,170,
%U 172,174,176,178,190,192,194,196,198,200,202,204,206,208,220,222,224,226,228,240,242,244,246,248
%N For any k, the cumulative sum of the terms a(1) + a(2) + a(3) + ... + a(k) and the cumulative sum of their digits so far are odd. This is the lexicographically earliest sequence of distinct terms > 0 with this property.
%C This is A179082 (even numbers having an even sum of digits in their decimal representation) where the first term [0] is replaced by [1].
%e Sequence = 1,2,4, 6, 8,20,22,24, 26, 28, 40, 42, 44 ...
%e Cumulative sum of terms = 1 3 7 13 21 41 63 87 113 141 181 223 267 ...
%e Cumulative sum of digits = 1 3 7 13 21 23 27 33 41 51 55 61 69 ...
%t a[1]=1;a[n_]:=a[n]=Block[{k=1},While[MemberQ[q=Array[a,n-1],k]||EvenQ@Total[s=Join[q,{k}]]||EvenQ@Total[Flatten[IntegerDigits/@s]],k++];k];Array[a,65] (* _Giorgos Kalogeropoulos_, May 11 2022 *)
%Y Cf. A179082.
%K base,nonn
%O 1,2
%A _Eric Angelini_, Feb 22 2021
|