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.

A031286 Additive persistence: number of summations of digits needed to obtain a single digit (the additive digital root).

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2
Offset: 0

Views

Author

Keywords

Crossrefs

Cf. A010888 (additive digital root of n).
Cf. A031347 (multiplicative digital root of n).
Cf. A031346 (multiplicative persistence of n).
Cf. also A006050, A045646.
Cf. Numbers with additive persistence k: A304366 (k=1), A304367 (k=2), A304368 (k=3), A304373 (k=4). - Jaroslav Krizek, May 28 2018

Programs

  • Maple
    read("transforms") ;
    A031286 := proc(n)
        local a,nper;
        nper := n ;
        a := 0 ;
        while nper > 9 do
            nper := digsum(nper) ;
            a := a+1 ;
        end do:
        a ;
    end proc:
    seq(A031286(n),n=0..80) ; # R. J. Mathar, Jan 02 2018
  • Mathematica
    lst = {}; Do[s = 0; While[n > 9, s++; n = Plus @@ IntegerDigits[n]]; AppendTo[lst, s], {n, 0, 98}]; lst (* Arkadiusz Wesolowski, Oct 17 2012 *)
  • PARI
    dsum(n)=my(s);while(n,s+=n%10;n\=10);s
    a(n)=my(s);while(n>9,s++;n=dsum(n));s \\ Charles R Greathouse IV, Sep 13 2012
    
  • Python
    def A031286(n):
        ap = 0
        while n > 9:
            n = sum(int(d) for d in str(n))
            ap += 1
        return ap
    # Chai Wah Wu, Aug 23 2014

Extensions

Corrected by Reinhard Zumkeller, Feb 05 2009

A304366 Numbers with additive persistence = 1.

Original entry on oeis.org

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, 115, 116
Offset: 1

Views

Author

Jaroslav Krizek, May 11 2018

Keywords

Comments

For d >= 2, there are A000581(d+8) terms with d digits. - Robert Israel, Dec 28 2023

Examples

			Adding the digits of 10 gives 1, a single-digit number, so 10 is a member. Adding the digits of 39 gives 12, which is a 2-digit number, so 39 is not a member. - _Michael B. Porter_, May 16 2018
		

Crossrefs

Cf. Numbers with additive persistence k: A304367 (k=2), A304368 (k=3), A304373 (k=4).

Programs

  • Maple
    select(t -> convert(convert(t,base,10),`+`) < 10, [$10 .. 200]); # Robert Israel, Dec 28 2023
  • Mathematica
    Select[Range@ 120, Length@ FixedPointList[Total@ IntegerDigits@ # &, #] == 3 &] (* Michael De Vlieger, May 14 2018 *)
  • PARI
    nb(n) = {my(nba = 0); while (n > 9, n = sumdigits(n); nba++); nba;}
    isok(n) = nb(n) == 1; \\ Michel Marcus, May 13 2018

Formula

A031286(a(n)) = 1.

A304367 Numbers n with additive persistence = 2.

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

Views

Author

Jaroslav Krizek, May 11 2018

Keywords

Comments

First deviation from A298638 is at a(161); a(161) = 299, A298638(161) = 307.

Examples

			Repeatedly taking the sum of digits starting with 19 gives 10 and then 1. There are two steps, so the additive persistence is 2, and 19 is a member. - _Michael B. Porter_, May 16 2018
		

Crossrefs

Cf. A031286.
Cf. Numbers with additive persistence k: A304366 (k=1), A304368 (k=3), A304373 (k=4).

Programs

  • Mathematica
    Select[Range@ 160, Length@ FixedPointList[Total@ IntegerDigits@ # &, #] == 4 &] (* Michael De Vlieger, May 14 2018 *)
  • PARI
    nb(n) = {my(nba = 0); while (n > 9, n = sumdigits(n); nba++); nba;}
    isok(n) = nb(n) == 2; \\ Michel Marcus, May 13 2018

Formula

A031286(a(n)) = 2.

A304368 Numbers n with additive persistence = 3.

Original entry on oeis.org

199, 289, 298, 379, 388, 397, 469, 478, 487, 496, 559, 568, 577, 586, 595, 649, 658, 667, 676, 685, 694, 739, 748, 757, 766, 775, 784, 793, 829, 838, 847, 856, 865, 874, 883, 892, 919, 928, 937, 946, 955, 964, 973, 982, 991, 1099, 1189, 1198, 1279, 1288, 1297
Offset: 1

Views

Author

Jaroslav Krizek, May 11 2018

Keywords

Comments

First deviation from A166459 is at a(101); a(101) = 1999, A166459(101) = 2089.

Examples

			Repeatedly taking the sum of digits starting with 199 gives 19, 10, and then 1. There are three steps, so the additive persistence is 3, and 199 is a member. - _Michael B. Porter_, May 16 2018
		

Crossrefs

Cf. A031286.
Cf. Numbers with additive persistence k: A304366 (k=1), A304367 (k=2), A304373 (k=4).

Programs

  • Mathematica
    Select[Range@ 1300, Length@ FixedPointList[Total@ IntegerDigits@ # &, #] == 5 &] (* Michael De Vlieger, May 14 2018 *)
  • PARI
    nb(n) = {my(nba = 0); while (n > 9, n = sumdigits(n); nba++); nba;}
    isok(n) = nb(n) == 3; \\ Michel Marcus, May 13 2018

Formula

A031286(a(n)) = 3.
Showing 1-4 of 4 results.