login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A107450 Additive persistence of the prime numbers. 1
0, 0, 0, 0, 1, 1, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 2, 2, 2, 2, 2, 1, 1, 1, 2, 1, 2, 1, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 1, 1, 2, 2, 1, 2, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 2, 1, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 3, 1, 2, 2, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 1, 2, 1, 2, 2 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,8
LINKS
EXAMPLE
29 -> 2 + 9 = 11 -> 1 + 1 = 2 -> persistence = 2
487 -> 4 + 8 + 7 = 19 -> 1 + 9 = 10 -> 1 + 0 = 1 -> persistence = 3
MAPLE
P:=proc(n) local i, k, w, ok, cont; for i from 1 by 1 to n do k:=ithprime(i); w:=0; ok:=1; if k<10 then print(0); else cont:=1; while ok=1 do while k>0 do w:=w+(k-(trunc(k/10)*10)); k:=trunc(k/10); od; if w<10 then ok:=0; print(cont); else cont:=cont+1; k:=w; w:=1; fi; od; fi; od; end: P(100);
MATHEMATICA
Table[Length[NestWhileList[Total[IntegerDigits[#]]&, n, #>9&]]-1, {n, Prime[ Range[100]]}] (* Harvey P. Dale, Aug 05 2014 *)
CROSSREFS
Cf. A031286 (additive persistence), A129985 (multiplicative persistence of primes).
Sequence in context: A188512 A081129 A022934 * A341765 A104248 A358359
KEYWORD
base,easy,nonn
AUTHOR
STATUS
approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 18 22:18 EDT 2024. Contains 371782 sequences. (Running on oeis4.)