cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A241181 Start with n; add to it any of its digits; repeat; a(n) = minimal number of steps needed to reach a prime.

This page as a plain text file.
%I A241181 #21 Jul 25 2020 18:38:21
%S A241181 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,
%T A241181 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,
%U A241181 4,4,0,1,0,2,4,1,3,3,0,4,1,3,0,2,3,2,2
%N A241181 Start with n; add to it any of its digits; repeat; a(n) = minimal number of steps needed to reach a prime.
%C A241181 a(n) = 0 iff n is a prime.
%C A241181 Is it a theorem that a(n) always exists?
%C A241181 Yes: the proof is similar to that of _Robert Israel_ for A241180. - _Rémy Sigrist_, Jul 25 2020
%D A241181 Eric Angelini, Posting to Sequence Fans Mailing List, Apr 20 2014
%H A241181 Hiroaki Yamanouchi, <a href="/A241181/b241181.txt">Table of n, a(n) for n = 1..100000</a>
%e A241181 Examples, in condensed notation:
%e A241181 1+1=2
%e A241181 2
%e A241181 3
%e A241181 4+4=8+8=16+1=17
%e A241181 5
%e A241181 6+6=12+1=13
%e A241181 7
%e A241181 8+8=16+1=17
%e A241181 9+9=18+1=19
%e A241181 10+1=11
%e A241181 11
%e A241181 12+1=13
%e A241181 13
%e A241181 14+4=18+1=19
%e A241181 15+1=16+1=17
%e A241181 16+1=17
%e A241181 17
%e A241181 18+1=19
%e A241181 19
%e A241181 20+2=22+2=24+2=26+6=32+2=34+3=37
%e A241181 ...
%t A241181 A241181[n_] := Module[{c, nx},
%t A241181    If[PrimeQ[n], Return[0]];
%t A241181    c = 1; nx = n;
%t A241181    While[ ! AnyTrue[nx = Flatten[nx + IntegerDigits[nx]], PrimeQ], c++];
%t A241181    Return[c]];
%t A241181 Table[A241181[i], {i, 100}] (* _Robert Price_, Mar 17 2019 *)
%Y A241181 Related sequences: A241173, A241174, A241175, A241176, A241177, A241178, A241179, A241180, A241181, A241182, A241183.
%K A241181 easy,nonn,base
%O A241181 1,4
%A A241181 _N. J. A. Sloane_, Apr 23 2014
%E A241181 a(23)-a(87) from _Hiroaki Yamanouchi_, Sep 05 2014