login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A298639 Numbers k such that the digital sum of k and the digital root of k have the same parity. 2
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, 27, 30, 31, 32, 33, 34, 35, 36, 40, 41, 42, 43, 44, 45, 50, 51, 52, 53, 54, 60, 61, 62, 63, 70, 71, 72, 80, 81, 90, 100, 101, 102, 103, 104, 105, 106, 107, 108, 110, 111, 112, 113, 114 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
COMMENTS
Numbers k such that A113217(k) = A179081(k).
Complement of A298638.
Agrees with A039691 until a(65): A039691(65) = 109 is not in this sequence.
LINKS
MATHEMATICA
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 *)
PROG
(Python)
#Digital sum of n.
def ds(n):
if n < 10:
return n
return n % 10 + ds(n//10)
def A298639(term_count):
seq = []
m = 0
n = 1
while n <= term_count:
s = ds(m)
r = ((m - 1) % 9) + 1 if m else 0
if s % 2 == r % 2:
seq.append(m)
n += 1
m += 1
return seq
print(A298639(100))
(PARI) dr(n)=if(n, (n-1)%9+1);
isok(n) = (sumdigits(n) % 2) == (dr(n) % 2); \\ Michel Marcus, Jan 26 2018
(PARI) is(n)=bittest(sumdigits(n)-(n-1)%9, 0)||!n \\ M. F. Hasler, Jan 26 2018
CROSSREFS
Sequence in context: A295020 A298359 A039691 * A276347 A076121 A239427
KEYWORD
nonn,easy,base
AUTHOR
J. Stauduhar, Jan 26 2018
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 19:02 EDT 2024. Contains 371798 sequences. (Running on oeis4.)