login
This site is supported by donations to The OEIS Foundation.
Logo

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A094830 Start with n, repeatedly replace x by x + sum of squares of digits of x until you reach a prime; sequence gives number of steps. 3
1, 0, 0, 6, 0, 4, 0, 11, 5, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 5, 13, 9, 0, 4, 11, 12, 17, 3, 0, 8, 0, 8, 7, 1, 7, 3, 0, 5, 7, 4, 0, 3, 0, 3, 7, 8, 0, 2, 2, 2, 6, 3, 0, 10, 2, 3, 1, 3, 0, 3, 0, 2, 2, 18, 2, 11, 0, 2, 6, 9, 0, 10, 0, 1, 1, 2, 5, 1, 0, 16, 2, 8, 0, 3, 11, 6, 10, 2, 0, 4, 1, 15, 2, 1, 9, 2, 0, 7, 7, 1 (list; graph; refs; listen; history; internal format)
OFFSET

1,4

EXAMPLE

a(4)=6 because 4 -> 20 -> 24 -> 44 -> 76 -> 161 -> 199, takes 6 steps to reach a prime.

MATHEMATICA

p[n_]:=Length[NestWhileList[#+Total[IntegerDigits[#]^2]&, n, !PrimeQ[ #]&]]-1; Array[p, 100] (* From Harvey P. Dale, Dec 03 2011 *)

CROSSREFS

Cf. A003132.

Sequence in context: A089841 A202542 A019766 * A196878 A021947 A073010

Adjacent sequences:  A094827 A094828 A094829 * A094831 A094832 A094833

KEYWORD

base,easy,nonn

AUTHOR

Jason Earls (zevi_35711(AT)yahoo.com), Jun 13 2004

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
Recent Additions | More pages | Superseeker | Maintained by The OEIS Foundation Inc.

Content is available under The OEIS End-User License Agreement .

Last modified February 15 05:45 EST 2012. Contains 205694 sequences.