editing
approved
editing
approved
The first occurrence of k beginning with 0: 1, 2, 17, 59, 337, 779, 16999, 6888888, ..., . [From _- _Robert G. Wilson v_, Oct 20 2010]
T(14)=4+5=9 --> T(9)=9 --> T(9)=9........ and we will never reach a prime.
g[n_] := Block[{id = IntegerDigits@ n}, Mod[ Plus @@ id, 10] + If[n < 10, 0, Times @@ id]]; f[n_] := Block[{lst = Rest@ NestWhileList[g, n, UnsameQ, All]}, lsp = PrimeQ@ lst; If[ Last@ Union@ lsp == False, 0, Position[lsp, True, 1, 1][[1, 1]]]]; Array[f, 105] [From _(* _Robert G. Wilson v_, Oct 20 2010] *)
approved
editing
proposed
approved
editing
proposed
_Felice Russo (felice.russo(AT)katamail.com), _, Sep 12 2002, Oct 11 2010
approved
editing
Edited by _N. J. A. Sloane, _, Oct 12 2010
The first occurrence of k beginning with 0: 1, 2, 17, 59, 337, 779, 16999, 6888888, ..., . [From _Robert G. Wilson v (rgwv(AT)rgwv.com), _, Oct 20 2010]
g[n_] := Block[{id = IntegerDigits@ n}, Mod[ Plus @@ id, 10] + If[n < 10, 0, Times @@ id]]; f[n_] := Block[{lst = Rest@ NestWhileList[g, n, UnsameQ, All]}, lsp = PrimeQ@ lst; If[ Last@ Union@ lsp == False, 0, Position[lsp, True, 1, 1][[1, 1]]]]; Array[f, 105] [From _Robert G. Wilson v (rgwv(AT)rgwv.com), _, Oct 20 2010]
More terms from _Robert G. Wilson v (rgwv(AT)rgwv.com), _, Oct 20 2010
0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 2, 1, 1, 0, 1, 1, 0, 1, 0, 1, 2, 1, 3, 2, 1, 1, 1, 1, 2, 1, 1, 2, 1, 2, 2, 1, 0, 0, 0, 1, 0, 1, 0, 1, 2, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 3, 0, 1, 2, 2, 0, 1, 3, 2, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 1, 2, 0, 1, 2, 2, 2, 1, 2, 1, 2, 1, 0, 0, 1, 1, 2, 3, 1, 2, 1, 1, 0, 1, 1, 0, 1, 0
The first occurrence of k beginning with 0: 1, 2, 17, 59, 337, 779, 16999, 6888888, ..., . [From Robert G. Wilson v (rgwv(AT)rgwv.com), Oct 20 2010]
g[n_] := Block[{id = IntegerDigits@ n}, Mod[ Plus @@ id, 10] + If[n < 10, 0, Times @@ id]]; f[n_] := Block[{lst = Rest@ NestWhileList[g, n, UnsameQ, All]}, lsp = PrimeQ@ lst; If[ Last@ Union@ lsp == False, 0, Position[lsp, True, 1, 1][[1, 1]]]]; Array[f, 105] [From Robert G. Wilson v (rgwv(AT)rgwv.com), Oct 20 2010]
easy,nonn,base,more,new
More terms from Robert G. Wilson v (rgwv(AT)rgwv.com), Oct 20 2010
Number Start with n and repeatedly apply the map k -> T(k) = A053837(k) + A171765(k); a(n) is the number of steps needed to reach (at least one) until a prime when the map S(n)+M(n) is applied to n; reached, or 0 if a no prime is never ever reached. Here S(n) and M(N) mean the sum and the product of the digits of n in base 10.
a(28)=3 because 28 ->26 ->20 ->2
T(2)=2. So in one step we reach a prime.
T(3)=3 and then in one step again we reach a prime.
T(4)=4 and we will never reach a prime.
T(11)=1+2=3 and again in one step we reach a prime.
T(17)=7+8=15 --> T(15)=5+6=11 and then in two steps we reach a prime.
T(13)=3+4=7 and then 1 step......
T(14)=4+5=9 --> T(9)=9 --> T(9)=9........ and we will never reach a prime
easy,nonn,base,more,new
Felice Russo (felice.russo(AT)katamail.com), Sep 12 2002, Oct 11 2010
Edited by N. J. A. Sloane, Oct 12 2010
Number of steps needed to reach a prime when the map S(n)+M(n) is applied to n; 0 if a prime is never reached. Here S(n) and M(N) mean the sum and the product of the digits of n in base 10.
0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 2, 1, 1, 1, 1, 0, 1, 0, 1, 2, 1, 3, 1, 1, 1, 1, 2, 1, 1, 2, 1, 2, 0, 0, 0, 0, 1, 0, 1, 2, 0, 0, 0, 1
1,17
a(28)=3 because 28 ->26 ->20 ->2
easy,nonn,base
Felice Russo (felice.russo(AT)katamail.com), Sep 12 2002
approved