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-6 of 6 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.

A119891 Prime trio leaders: largest number of a prime trio.

Original entry on oeis.org

29, 47, 83, 137, 173, 191, 227, 263, 281, 317, 353, 443, 461, 599, 641, 797, 821, 887, 911, 977, 1019, 1091, 1109, 1163, 1181, 1217, 1307, 1361, 1433, 1451, 1499, 1523, 1613, 1697, 1721, 1787, 1811, 1877, 1901, 1949, 2027, 2063, 2081, 2153, 2207, 2243
Offset: 1

Views

Author

Luc Stevens (lms022(AT)yahoo.com), May 27 2006

Keywords

Comments

A prime trio is a set of three distinct prime numbers such that the third number is a 1-digit number which is the sum of the digits of the second number and the second number is the sum of the digits of the first number.

Examples

			443 is in the sequence because it is the largest number of the prime trio (443, 11, 2).
599 is the first term with sum of digits different from 11 (cf. A106754), namely 23 (cf. A106762). This sequence contains also all primes with sum of digits equal to 41, 43, 61 etc., but not 29, 47, ... since the second digit sum must be a single-digit prime, i.e., 2, 3, 5 or 7. - _M. F. Hasler_, Mar 09 2022
		

Crossrefs

Subsequence of A304367.
Cf. A000040 (primes), A007953 (sum of digits), A106754 (primes with s.o.d. = 11), A106762 (s.o.d.(p) = 23), A106774 (s.o.d.(p) = 41), A106775 (s.o.d.(p) = 43), A106787 (s.o.d.(p) = 61): subsequences.

Programs

  • Maple
    filter:= proc(n) local x,y;
      if not isprime(n) then return false fi;
      x:= convert(convert(n,base,10),`+`);
      if x < 10 or not isprime(x) then return false fi;
      y:= convert(convert(x,base,10),`+`);
      member(y,{2,3,5,7})
    end proc:
    select(filter, [seq(i,i=11..10000,2)]); # Robert Israel, May 21 2021
  • Mathematica
    ptQ[n_]:=Module[{c=NestList[Total[IntegerDigits[#]]&,n,2]},Length[ Union[c]] == 3&&And@@PrimeQ[c]]; Select[Prime[Range[500]],ptQ] (* Harvey P. Dale, Aug 15 2012 *)
  • PARI
    select( {is_A119891(n, s=sumdigits(n))=bittest(172, sumdigits(s)) && isprime(s) && s>9 && isprime(n)}, primes([1,2345])) \\ M. F. Hasler, Mar 09 2022

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.

A304373 Numbers n with additive persistence = 4.

Original entry on oeis.org

19999999999999999999999, 28999999999999999999999, 29899999999999999999999, 29989999999999999999999, 29998999999999999999999, 29999899999999999999999, 29999989999999999999999, 29999998999999999999999, 29999999899999999999999, 29999999989999999999999
Offset: 1

Views

Author

Jaroslav Krizek, May 28 2018

Keywords

Examples

			Repeatedly taking the sum of digits starting with 19999999999999999999999 gives 199, 19, 10 and 1. There are four steps, so the additive persistence is 4 and 19999999999999999999999 is a member.
		

Crossrefs

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

Programs

  • Mathematica
    Take[ Sort@ Flatten[ (FromDigits /@ Permutations@#) & /@ IntegerPartitions[ 199, {23}, Range@ 9]], 10000] (* first 10000 terms, Giovanni Resta, May 29 2018 *)
  • PARI
    nb(n) = {my(nba = 0); while (n > 9, n = sumdigits(n); nba++); nba;}
    isok(n) = nb(n) == 4; \\ Michel Marcus, May 29 2018

Formula

A031286(a(n)) = 4.

A316155 Numbers with additive persistence = 4 and digits in nondecreasing order.

Original entry on oeis.org

19999999999999999999999, 28999999999999999999999, 37999999999999999999999, 38899999999999999999999, 46999999999999999999999, 47899999999999999999999, 48889999999999999999999, 55999999999999999999999, 56899999999999999999999, 57799999999999999999999, 57889999999999999999999
Offset: 1

Views

Author

Jaroslav Krizek, Jun 25 2018

Keywords

Comments

All terms of <= 32 digits have digit sum 199. - Robert Israel, Jun 25 2018

Examples

			Repeatedly taking the sum of digits starting with 19999999999999999999999 gives 199, 19, 10 and 1. There are four steps, so the additive persistence is 4 and 19999999999999999999999 is a member.
		

Crossrefs

Programs

  • Maple
    S:= proc(d,t,m) # d digits of sum t with max m
        option remember;
        local j;
      if d*m < t then return [] fi;
      if d = 1 then if t > 0 then return [[t]] else return [] fi fi;
      [seq(op(map(L -> [op(L),j], procname(d-1,t-j,j))),j=1..min(m,t))]
    end proc:
    seq(op(sort(map(t -> add(t[-i]*10^(i-1),i=1..nops(t)), S(d,199,9)))),d=23..24); # Robert Israel, Jun 25 2018

Formula

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