This site is supported by donations to The OEIS Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A031286 Additive persistence: number of summations of digits needed to obtain a single digit (the additive digital root). 19

%I

%S 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,

%T 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,

%U 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

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

%H Chai Wah Wu, <a href="/A031286/b031286.txt">Table of n, a(n) for n = 0..10000</a>

%H N. J. A. Sloane, <a href="http://neilsloane.com/doc/persistence.html">The persistence of a number</a>, J. Recreational Math., 6 (1973), 97-98.

%p A031286 := proc(n)

%p local a,nper;

%p nper := n ;

%p a := 0 ;

%p while nper > 9 do

%p nper := digsum(nper) ;

%p a := a+1 ;

%p end do:

%p a ;

%p end proc:

%p seq(A031286(n),n=0..80) ; # _R. J. Mathar_, Jan 02 2018

%t lst = {}; Do[s = 0; While[n > 9, s++; n = Plus @@ IntegerDigits[n]]; AppendTo[lst, s], {n, 0, 98}]; lst (* _Arkadiusz Wesolowski_, Oct 17 2012 *)

%o (PARI) dsum(n)=my(s);while(n,s+=n%10;n\=10);s

%o a(n)=my(s);while(n>9,s++;n=dsum(n));s \\ _Charles R Greathouse IV_, Sep 13 2012

%o (Python)

%o def A031286(n):

%o ....ap = 0

%o ....while (n > 9):

%o ........n = sum((int(d) for d in str(n)))

%o ........ap += 1

%o ....return ap

%o # _Chai Wah Wu_, Aug 23 2014

%Y Cf. A010888 (additive digital root of n).

%Y Cf. A031347 (multiplicative digital root of n).

%Y Cf. A031346 (multiplicative persistence of n).

%Y Cf. also A006050, A045646.

%Y Cf. Numbers with additive persistence k: A304366 (k=1), A304367 (k=2), A304368 (k=3), A304373 (k=4). - _Jaroslav Krizek_, May 28 2018

%K nonn,base

%O 0,20

%A _Eric W. Weisstein_

%E Corrected by _Reinhard Zumkeller_, Feb 05 2009

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

Last modified October 23 23:51 EDT 2019. Contains 328379 sequences. (Running on oeis4.)