Re: Concatenation of prime factors of numbers
- To: mathgroup at smc.vnet.net
- Subject: [mg78644] Re: [mg78599] Concatenation of prime factors of numbers
- From: János <janos.lobb at yale.edu>
- Date: Fri, 6 Jul 2007 03:19:08 -0400 (EDT)
- References: <200707050801.EAA01451@smc.vnet.net>
On Jul 5, 2007, at 4:01 AM, Diana wrote:
> Can someone help me with this trick?
>
> I would like to create the following sequence, based on FactorInteger:
>
> 2,3,22,5,23,7,222,33,25,11,223,13,27,35,2222, ...
>
> where each term is the concatenation of the prime factors of n.
>
> Thanks,
>
> Diana
>
Here is a newbie approach - without Wikipedia:
In[1]:=
Table[ToExpression[
StringJoin[
(If[#1[[2]] == 1,
ToString[#1[[1]]],
For[j = 2; a =
ToString[#1[[1]]],
j <= #1[[2]], j++,
a = StringExpression[
a, ToString[
#1[[1]]]]];
a] & ) /@
FactorInteger[i]]],
{i, 2, 16}]
Out[1]=
{2, 3, 22, 5, 23, 7, 222, 33,
25, 11, 223, 13, 27, 35,
2222}
J=E1nos
-----------------------------------------
A newbie is a newbie is a newbie (even if he has Wikipedia to help him).
- Andrzej Kozlowski
- References:
- Concatenation of prime factors of numbers
- From: Diana <diana.mecum@gmail.com>
- Concatenation of prime factors of numbers