OFFSET
1,1
LINKS
Eric Weisstein's World of Mathematics, Additive Persistence.
FORMULA
A031286(a(n)) = 3.
EXAMPLE
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
MATHEMATICA
Select[Range@ 1300, Length@ FixedPointList[Total@ IntegerDigits@ # &, #] == 5 &] (* Michael De Vlieger, May 14 2018 *)
PROG
(PARI) nb(n) = {my(nba = 0); while (n > 9, n = sumdigits(n); nba++); nba; }
isok(n) = nb(n) == 3; \\ Michel Marcus, May 13 2018
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Jaroslav Krizek, May 11 2018
STATUS
approved