MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Concatenation of prime factors of numbers

  • To: mathgroup at smc.vnet.net
  • Subject: [mg78654] Re: [mg78599] Concatenation of prime factors of numbers
  • From: DrMajorBob <drmajorbob at bigfoot.com>
  • Date: Fri, 6 Jul 2007 03:24:18 -0400 (EDT)
  • References: <30391773.1183623698978.JavaMail.root@m35>
  • Reply-to: drmajorbob at bigfoot.com

primeFactorString[n_Integer?Positive] :=
  StringJoin @@ (FactorInteger[n] /. {i_Integer, j_Integer} :>
      StringJoin @@ ConstantArray[ToString[i], j])

primeFactorString /@ Range[20]

{"1", "2", "3", "22", "5", "23", "7", "222", "33", "25", "11", "223", \
"13", "27", "35", "2222", "17", "233", "19", "225"}

Bobby

On Thu, 05 Jul 2007 03:01:24 -0500, Diana <diana.mecum at gmail.com> 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
>
>
>



-- 

DrMajorBob at bigfoot.com


  • Prev by Date: save as (regular) html problem
  • Next by Date: RE: Concatenation of prime factors of numbers
  • Previous by thread: Re: Concatenation of prime factors of numbers
  • Next by thread: Re: Concatenation of prime factors of numbers