cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-1 of 1 results.

A298638 Numbers k such that the digital sum of k and the digital root of k have opposite parity.

Original entry on oeis.org

19, 28, 29, 37, 38, 39, 46, 47, 48, 49, 55, 56, 57, 58, 59, 64, 65, 66, 67, 68, 69, 73, 74, 75, 76, 77, 78, 79, 82, 83, 84, 85, 86, 87, 88, 89, 91, 92, 93, 94, 95, 96, 97, 98, 99, 109, 118, 119, 127, 128, 129, 136, 137, 138, 139, 145, 146, 147, 148, 149, 154, 155
Offset: 1

Views

Author

J. Stauduhar, Jan 23 2018

Keywords

Comments

Numbers k such that A113217(k) <> A179081(k).
Complement of A298639.
Agrees with A291884 until a(46): a(46) = 109 is not in that sequence.

Crossrefs

Programs

  • Mathematica
    Select[Range[145], EvenQ@ Total@ IntegerDigits@ # != EvenQ@ NestWhile[Total@ IntegerDigits@ # &, #, # > 9 &] &] (* Michael De Vlieger, Feb 03 2018 *)
  • PARI
    isok(n) = sumdigits(n) % 2 != if (n, ((n-1)%9+1) % 2, 0); \\ Michel Marcus, Mar 01 2018
  • Python
    #Digital sum of n.
    def ds(n):
      if n < 10:
        return n
      return n % 10 + ds(n//10)
    def A298638(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(A298638(100))
    
Showing 1-1 of 1 results.