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!)
A241181 Start with n; add to it any of its digits; repeat; a(n) = minimal number of steps needed to reach a prime. 12
1, 0, 0, 3, 0, 2, 0, 2, 2, 1, 0, 1, 0, 2, 2, 1, 0, 1, 0, 6, 1, 5, 0, 4, 2, 3, 1, 5, 0, 6, 0, 2, 5, 1, 2, 4, 0, 1, 3, 4, 0, 4, 0, 3, 2, 3, 0, 2, 1, 5, 2, 2, 0, 1, 4, 1, 4, 3, 0, 3, 0, 3, 3, 3, 1, 2, 0, 2, 4, 4, 0, 1, 0, 2, 4, 1, 3, 3, 0, 4, 1, 3, 0, 2, 3, 2, 2 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,4
COMMENTS
a(n) = 0 iff n is a prime.
Is it a theorem that a(n) always exists?
Yes: the proof is similar to that of Robert Israel for A241180. - Rémy Sigrist, Jul 25 2020
REFERENCES
Eric Angelini, Posting to Sequence Fans Mailing List, Apr 20 2014
LINKS
EXAMPLE
Examples, in condensed notation:
1+1=2
2
3
4+4=8+8=16+1=17
5
6+6=12+1=13
7
8+8=16+1=17
9+9=18+1=19
10+1=11
11
12+1=13
13
14+4=18+1=19
15+1=16+1=17
16+1=17
17
18+1=19
19
20+2=22+2=24+2=26+6=32+2=34+3=37
...
MATHEMATICA
A241181[n_] := Module[{c, nx},
If[PrimeQ[n], Return[0]];
c = 1; nx = n;
While[ ! AnyTrue[nx = Flatten[nx + IntegerDigits[nx]], PrimeQ], c++];
Return[c]];
Table[A241181[i], {i, 100}] (* Robert Price, Mar 17 2019 *)
CROSSREFS
Sequence in context: A230446 A260737 A059339 * A171772 A092735 A035464
KEYWORD
easy,nonn,base
AUTHOR
N. J. A. Sloane, Apr 23 2014
EXTENSIONS
a(23)-a(87) from Hiroaki Yamanouchi, Sep 05 2014
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 19 19:02 EDT 2024. Contains 371798 sequences. (Running on oeis4.)