Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #33 Sep 25 2023 15:05:57
%S 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,20,21,22,23,24,25,26,
%T 27,30,31,32,33,34,35,36,40,41,42,43,44,45,50,51,52,53,54,60,61,62,63,
%U 70,71,72,80,81,90,100,101,102,103,104,105,106,107,108,110,111,112,113,114
%N Numbers k such that the digital sum of k and the digital root of k have the same parity.
%C Numbers k such that A113217(k) = A179081(k).
%C Complement of A298638.
%C Agrees with A039691 until a(65): A039691(65) = 109 is not in this sequence.
%H J. Stauduhar, <a href="/A298639/b298639.txt">Table of n, a(n) for n = 1..10000</a>
%t fQ[n_] := Mod[Plus @@ IntegerDigits@n, 2] == Mod[Mod[n -1, 9] +1, 2]; fQ[0] = True; Select[ Range[0, 104], fQ] (* _Robert G. Wilson v_, Jan 26 2018 *)
%o (Python)
%o #Digital sum of n.
%o def ds(n):
%o if n < 10:
%o return n
%o return n % 10 + ds(n//10)
%o def A298639(term_count):
%o seq = []
%o m = 0
%o n = 1
%o while n <= term_count:
%o s = ds(m)
%o r = ((m - 1) % 9) + 1 if m else 0
%o if s % 2 == r % 2:
%o seq.append(m)
%o n += 1
%o m += 1
%o return seq
%o print(A298639(100))
%o (PARI) dr(n)=if(n, (n-1)%9+1);
%o isok(n) = (sumdigits(n) % 2) == (dr(n) % 2); \\ _Michel Marcus_, Jan 26 2018
%o (PARI) is(n)=bittest(sumdigits(n)-(n-1)%9,0)||!n \\ _M. F. Hasler_, Jan 26 2018
%Y Cf. A007953, A010888, A113217, A179081, A298638, A039691.
%K nonn,easy,base
%O 1,3
%A _J. Stauduhar_, Jan 26 2018