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-4 of 4 results.

A010888 Digital root of n (repeatedly add the digits of n until a single digit is reached).

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5
Offset: 0

Views

Author

Keywords

Comments

This is sometimes also called the additive digital root of n.
n mod 9 (A010878) is a very similar sequence.
Partial sums are given by A130487(n-1) + n (for n > 0). - Hieronymus Fischer, Jun 08 2007
Decimal expansion of 13717421/111111111 is 0.123456789123456789123456789... with period 9. - Eric Desbiaux, May 19 2008
Decimal expansion of 13717421 / 1111111110 = 0.0[123456789] (periodic) - Daniel Forgues, Feb 27 2017
a(A005117(n)) < 9. - Reinhard Zumkeller, Mar 30 2010
My friend Jahangeer Kholdi has found that 19 is the smallest prime p such that for each number n, a(p*n) = a(n). In fact we have: a(m*n) = a(a(m)*a(n)) so all numbers with digital root 1 (numbers of the form 9k + 1) have this property. See comment lines of A017173. Also we have a(m+n) = a(a(m) + a(n)). - Farideh Firoozbakht, Jul 23 2010

Examples

			The digits of 37 are 3 and 7, and 3 + 7 = 10. And the digits of 10 are 1 and 0, and 1 + 0 = 1, so a(37) = 1.
		

References

  • Martin Gardner, Mathematics, Magic and Mystery, 1956.

Crossrefs

Cf. A007953, A007954, A031347, A113217, A113218, A010878 (n mod 9), A010872, A010873, A010874, A010875, A010876, A010877, A010879, A004526, A002264, A002265, A002266, A017173, A031286 (additive persistence of n), (multiplicative digital root of n), A031346 (multiplicative persistence of n).

Programs

Formula

If n = 0 then a(n) = 0; otherwise a(n) = (n reduced mod 9), but if the answer is 0 change it to 9.
Equivalently, if n = 0 then a(n) = 0, otherwise a(n) = (n - 1 reduced mod 9) + 1.
If the initial 0 term is ignored, the sequence is periodic with period 9.
From Hieronymus Fischer, Jun 08 2007: (Start)
a(n) = A010878(n-1) + 1 (for n > 0).
G.f.: g(x) = x*(Sum_{k = 0..8}(k+1)*x^k)/(1 - x^9). Also: g(x) = x(9x^10 - 10x^9 + 1)/((1 - x^9)(1 - x)^2). (End)
a(n) = n - 9*floor((n-1)/9), for n > 0. - José de Jesús Camacho Medina, Nov 10 2014

A113218 Lexicographically earliest permutation of the natural numbers with alternating parities of digital roots in decimal representation.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 10, 13, 12, 15, 14, 17, 16, 20, 18, 22, 19, 24, 21, 26, 23, 29, 25, 31, 27, 33, 28, 35, 30, 38, 32, 40, 34, 42, 36, 44, 37, 47, 39, 49, 41, 51, 43, 53, 45, 56, 46, 58, 48, 60, 50, 62, 52, 65, 54, 67, 55, 69, 57, 71, 59, 74, 61, 76, 63, 78, 64, 80
Offset: 0

Views

Author

Reinhard Zumkeller, Oct 18 2005

Keywords

Comments

inverse: A113220; A113219 = a(a(n));
A113217(a(n)) = A000035(n).

Crossrefs

Cf. A010888.

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))
    

A298639 Numbers k such that the digital sum of k and the digital root of k have the same parity.

Original entry on oeis.org

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
Offset: 1

Views

Author

J. Stauduhar, Jan 26 2018

Keywords

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.

Crossrefs

Programs

  • 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 *)
  • 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
  • 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))
    
Showing 1-4 of 4 results.