<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:admin="http://webns.net/mvcb/"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
	<channel> 

	<title>Comments on: POW 1UP</title>
	<link>http://ask.metafilter.com/149596/POW-1UP/</link>
	<description>Comments on Ask MetaFilter post POW 1UP</description>
	<pubDate>Sat, 27 Mar 2010 05:25:18 -0800</pubDate>
	<lastBuildDate>Sat, 27 Mar 2010 05:25:18 -0800</lastBuildDate>
	<language>en-us</language>
	<docs>http://blogs.law.harvard.edu/tech/rss</docs>
	<ttl>60</ttl>

	<item>
		<title>Question: POW 1UP</title>
		<link>http://ask.metafilter.com/149596/POW-1UP</link>	
		<description>Is there a closed-form method for finding the unique subsets from the power set of prime factors of an integer? &lt;br /&gt;&lt;br /&gt; Let&apos;s say I start with the integer 28, with prime factors {2, 2, 7}.&lt;br&gt;
&lt;br&gt;
If I construct a power set from this set of factors, I get:&lt;br&gt;
&lt;br&gt;
{{nil}, {2}, {2}, {7}, {2,2}, {2,7}, {2, 7}, {2, 2, 7}}&lt;br&gt;
&lt;br&gt;
I can reduce this to a set of divisors by multiplying the elements inside the non-empty subsets, to get {2, 7, 4, 14, 28} (adding {1} as a default divisor).&lt;br&gt;
&lt;br&gt;
However, two of the subsets are duplicates: {2} and {2,7}, so I am doing unnecessary calculations by simply iterating through all subsets. &lt;br&gt;
&lt;br&gt;
I could loop through the subsets and keep a hash table of multiplied elements-as-keys or some similar brute force approach. But as a power set grows quickly, there could be a very large number of subsets. &lt;br&gt;
&lt;br&gt;
Is there a smarter, more general way to do this, if I know what the labels (prime factors) are, something like a unique permutation of the factors, where some factors might be repeated?&lt;br&gt;
&lt;br&gt;
(Note: This isn&apos;t homework.)</description>
		<guid isPermaLink="false">post:ask.metafilter.com,2010:site.149596</guid>
		<pubDate>Sat, 27 Mar 2010 05:19:21 -0800</pubDate>
		<dc:creator>Blazecock Pileon</dc:creator>
		
			<category>math</category>
		
			<category>set</category>
		
			<category>powerset</category>
		
			<category>prime</category>
		
			<category>factor</category>
		
			<category>factorization</category>
		
			<category>number</category>
		
			<category>numbertheory</category>
		
			<category>resolved</category>
		
	</item> <item>
		<title>By: madcaptenor</title>
		<link>http://ask.metafilter.com/149596/POW-1UP#2142924</link>	
		<description>Let&apos;s say your number has the factorization p_1^(e_1) p_2^(e_2) ... p_m^(e_m), where the p_i are distinct primes.  For example, 28 = 2^2 7^1.&lt;br&gt;
&lt;br&gt;
Then you want p_1^(f_1) ... p_m^(f_m) for each m-tuple (f_1, ..., f_m) where f_k is between 0 and e_k (inclusive).</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2010:site.149596-2142924</guid>
		<pubDate>Sat, 27 Mar 2010 05:25:18 -0800</pubDate>
		<dc:creator>madcaptenor</dc:creator>
	</item><item>
		<title>By: advil</title>
		<link>http://ask.metafilter.com/149596/POW-1UP#2142931</link>	
		<description>&lt;i&gt;two of the subsets are duplicates: {2} and {2,7}, so I am doing unnecessary calculations by simply iterating through all subsets.&lt;/i&gt;&lt;br&gt;
&lt;br&gt;
If you are actually representing these using some kind of set data structure, duplicates should be removed for you automatically.  By definition sets don&apos;t contain duplicates (e.g. {{0}, {0}} is the same set as {{0}}).  However, if you are using a multiset, it won&apos;t do this for you.  If you are rolling your own data structure, maybe the thing to do would be to see how a standard implementation of a set would do this.  (Or just use one.)</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2010:site.149596-2142931</guid>
		<pubDate>Sat, 27 Mar 2010 06:20:42 -0800</pubDate>
		<dc:creator>advil</dc:creator>
	</item><item>
		<title>By: bsdfish</title>
		<link>http://ask.metafilter.com/149596/POW-1UP#2143003</link>	
		<description>Exactly what madcaptenor said: write out all the unique prime factors and how often each one occurs.  Then, every element of the factor power set can be written in terms of taking f_1 of the first factor, f_2 of the 2nd factor, etc...&lt;br&gt;
&lt;br&gt;
On that note, if there are factors p_1, p_2, ... p_m with counts e_1, e_2, ... , e_m, the number has (1+e_1) * (1+e_2) ... * (1+e_m) factors including 1 and itself.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2010:site.149596-2143003</guid>
		<pubDate>Sat, 27 Mar 2010 08:07:00 -0800</pubDate>
		<dc:creator>bsdfish</dc:creator>
	</item><item>
		<title>By: DU</title>
		<link>http://ask.metafilter.com/149596/POW-1UP#2143023</link>	
		<description>&lt;i&gt;(Note: This isn&apos;t homework.) &lt;/i&gt;&lt;br&gt;
&lt;br&gt;
I&apos;m pretty sure it&apos;s &lt;a href=&quot;http://projecteuler.net/&quot;&gt;Euly&lt;/a&gt;, though.&lt;br&gt;
&lt;br&gt;
Anyway, I agree with the above: Keep track of unique primes and the powers thereof.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2010:site.149596-2143023</guid>
		<pubDate>Sat, 27 Mar 2010 08:43:43 -0800</pubDate>
		<dc:creator>DU</dc:creator>
	</item><item>
		<title>By: Blazecock Pileon</title>
		<link>http://ask.metafilter.com/149596/POW-1UP#2143380</link>	
		<description>&lt;em&gt;If you are actually representing these using some kind of set data structure, duplicates should be removed for you automatically.&lt;/em&gt;&lt;br&gt;
&lt;br&gt;
That would be language or implementation dependent, and a kind of a cheat. My hope was to find a method for generating a power set that automatically removes duplicates, without relying on the vagaries of a particular language. But instead of using a power set, it seems better to just use an ordered tuple approach, once I have the factorization.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2010:site.149596-2143380</guid>
		<pubDate>Sat, 27 Mar 2010 16:48:59 -0800</pubDate>
		<dc:creator>Blazecock Pileon</dc:creator>
	</item><item>
		<title>By: albrecht</title>
		<link>http://ask.metafilter.com/149596/POW-1UP#2143485</link>	
		<description>&lt;em&gt;Then you want p_1^(f_1) ... p_m^(f_m) for each m-tuple (f_1, ..., f_m) where f_k is between 0 and e_k (inclusive).&lt;/em&gt;&lt;br&gt;
&lt;br&gt;
Isn&apos;t that also just the list of factors?</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2010:site.149596-2143485</guid>
		<pubDate>Sat, 27 Mar 2010 19:38:52 -0800</pubDate>
		<dc:creator>albrecht</dc:creator>
	</item><item>
		<title>By: madcaptenor</title>
		<link>http://ask.metafilter.com/149596/POW-1UP#2143786</link>	
		<description>albrecht, I thought the list of factors is what Blazecock was asking for.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2010:site.149596-2143786</guid>
		<pubDate>Sun, 28 Mar 2010 06:53:09 -0800</pubDate>
		<dc:creator>madcaptenor</dc:creator>
	</item><item>
		<title>By: albrecht</title>
		<link>http://ask.metafilter.com/149596/POW-1UP#2143805</link>	
		<description>Oh, sorry; I misunderstood the question.  In that case, your answer is definitely the way to go.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2010:site.149596-2143805</guid>
		<pubDate>Sun, 28 Mar 2010 07:35:54 -0800</pubDate>
		<dc:creator>albrecht</dc:creator>
	</item><item>
		<title>By: Blazecock Pileon</title>
		<link>http://ask.metafilter.com/149596/POW-1UP#2145878</link>	
		<description>No, I have the factors. I was trying to build a count of divisors. Using a power set will introduce duplicates. So I just need to generate permutations of factors a different way.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2010:site.149596-2145878</guid>
		<pubDate>Tue, 30 Mar 2010 03:25:09 -0800</pubDate>
		<dc:creator>Blazecock Pileon</dc:creator>
	</item>
	</channel>
</rss>
