<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>quexotic &#187; Mathematics</title>
	<atom:link href="http://quexotic.org/?cat=6&#038;feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://quexotic.org</link>
	<description></description>
	<lastBuildDate>Thu, 19 Mar 2026 18:44:28 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5</generator>
		<item>
		<title>2010 Joint Meetings of the American Mathematical Society</title>
		<link>http://quexotic.org/?p=56</link>
		<comments>http://quexotic.org/?p=56#comments</comments>
		<pubDate>Sun, 04 Apr 2010 09:20:04 +0000</pubDate>
		<dc:creator>keith</dc:creator>
				<category><![CDATA[Mathematics]]></category>
		<category><![CDATA[Science]]></category>

		<guid isPermaLink="false">http://quexotic.org/?p=56</guid>
		<description><![CDATA[Garrett Lisi and E8: &#8220;The universe is maximally beautiful.&#8221; Ron Graham Don Knuth: importunate permutation The wonderful Cliff Stoll presents a Steiger Millionaire challenge; always offering me Acme Klein Bottles and his peculiar brand of crystal ball. Enigma]]></description>
				<content:encoded><![CDATA[<p>Garrett Lisi and E8: &#8220;The universe is maximally beautiful.&#8221;</p>
<p><a href='http://quexotic.org/wp-content/uploads/2010/04/img_2256.jpg' title='Garrett Lisi'><img height="480" width="640" src='http://quexotic.org/wp-content/uploads/2010/04/img_2256.jpg' alt='Garrett Lisi' /></a></p>
<p>Ron Graham<br />
<a href='http://quexotic.org/wp-content/uploads/2010/04/img_2264.jpg' title='Draconis and Graham'><img height="480" width="640" src='http://quexotic.org/wp-content/uploads/2010/04/img_2264.jpg' alt='Draconis and Graham' /></a></p>
<p>Don Knuth: importunate permutation<br />
<a href='http://quexotic.org/wp-content/uploads/2010/04/img_2275.jpg' title='Don Knuth'><img height="480" width="640"  src='http://quexotic.org/wp-content/uploads/2010/04/img_2275.jpg' alt='Don Knuth' /></a></p>
<p>The wonderful Cliff Stoll presents a Steiger Millionaire challenge; always offering me Acme Klein Bottles and his peculiar brand of crystal ball.<br />
<a href='http://quexotic.org/wp-content/uploads/2010/04/img_2261.jpg' title='Cliff Stoll'><img height="480" width="640" src='http://quexotic.org/wp-content/uploads/2010/04/img_2261.jpg' alt='Cliff Stoll' /></a></p>
<p>Enigma<br />
<a href='http://quexotic.org/wp-content/uploads/2010/04/img_2257.jpg' title='Enigma'><img height="480" width="640" src='http://quexotic.org/wp-content/uploads/2010/04/img_2257.jpg' alt='Enigma' /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://quexotic.org/?feed=rss2&#038;p=56</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Integers in Euclidean Space Order</title>
		<link>http://quexotic.org/?p=46</link>
		<comments>http://quexotic.org/?p=46#comments</comments>
		<pubDate>Fri, 27 Nov 2009 21:50:42 +0000</pubDate>
		<dc:creator>keith</dc:creator>
				<category><![CDATA[Mathematics]]></category>

		<guid isPermaLink="false">http://quexotic.org/?p=46</guid>
		<description><![CDATA[Consider the factored integers N=[(0), (1), (2), (3), (2,2), 5, (2,3), 7, (2,2,2)...], with each factor representing a point in Euclidean space. Each of these points is at a distance d from the origin, and can be ordered by d. &#8230; <a href="http://quexotic.org/?p=46">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Consider the factored integers N=[(0), (1), (2), (3), (2,2), 5, (2,3), 7, (2,2,2)...], with each factor representing a point in Euclidean space. Each of these points is at a distance d from the origin, and can be ordered by d.</p>
<pre>
-- Ieso.hs
-- Integers in Euclidean space order

-- Uses the Haskell Number Theory functions, from the "Haskell for Maths"
-- site: http://www.polyomino.f2s.com/david/haskell/numbertheory.html
import Data.List
import Primes

-- Return distance between two points in Euclidean space. Points are lists 
-- of possibly unequal lengths, padded with zeros as needed.
dist_points x y = sqrt (realToFrac ((foldl (+) 0 (map sq (zipWith (-) x1 y1)))))
           where x1 = pad (lengthLongest [x,y]) x
                 y1 = pad (lengthLongest [x,y]) y
                 sq x = x * x
                 lengthLongest l = maximum (map length l)
                 pad len x = (x ++ zeroPadding) 
                     where zeroPadding = genericTake (len - genericLength x) (repeat 0)

-- Return list of all prime factors of n
primeFactors 1 = [1]
primeFactors n = flatten (map expandedFactors (primePowerFactors n))
            where
              expandedFactors x = genericTake (snd x) (repeat (fst x))
              flatten :: [[a]] -> [a]
              flatten = foldl (++) []

-- Return distance between two factored integers 
distance n m = dist_points (primeFactors n) (primeFactors m)

-- Return list of distances between origin and integers up to n,
-- sorted by distance d. Where ties occur, the lowest n comes first, i.e., 
-- where d=5 for both n=48 and n=5, the order is ... 5, 48 ....
-- Neil Sloane has suggested a different way of breaking ties is use of 
-- lexicographic order, ie for n=48 [2,2,2,3] comes before n=5 [5] - see
-- below.
distanceOrigin n = map snd (sort d)
                   where
                     d = [(distance 0 i, i) | i <- [0..n]]

-- In order to list the integers within a certain distance d from the origin,
-- we have to calculate distances up to 2^(d^2/4), e.g. to list ALL 
-- integers within a distance of 10, use range 2...2^25.

-- I believe a list is "complete" up to where a power of 2 appears, 
-- because numbers greater than that power of 2 can't be closer 
-- to the origin (except ties, depending on they are handled). However, 
-- I am curious about how to determine the  minimum number of 
-- integers you have to calculate in order to make a list complete, 
-- e.g., how high do we have to look to be sure we've found the
-- 20 integers closest to the origin? 

main = do
  -- Calculate integers within ~7 units of origin
  print "n ordering for ties"
  let d = [(distance 0 i, i) | i <- [0..8192]]
  print (map snd (sort d))

  -- Recalculate using lexicographic order to break ties
  print "lexicographical ordering for ties"  
  let l = [(distance 0 i, primeFactors i, i) | i <- [0..8192]]
  print (map lastx (sort l))
        where
          lastx (x, y, z) = z
 </pre>
<p>For example, d=8.66 for N=125 at the point (5,5,5), while d=5.29 for N=128 at (2,2,2,2,2,2,2) :</p>
<pre>
*Ieso> distance 0 125
8.660254037844387
*Ieso> distance 0 128
5.291502622129181
</pre>
<p>Here is a simple view of several of these integers that lie in 3-space, with the distance between the origin and N=125 highlighted.<br />
<a href='http://quexotic.org/wp-content/uploads/2009/11/3d.gif' title='3d.gif'><img src='http://quexotic.org/wp-content/uploads/2009/11/3d.gif' alt='3d.gif' /></a><br />
The sequence N=[0..8192] in Euclidean space ordered by d begins</p>
<pre> 
*Ieso> distanceOrigin 8192
0,1,2,4,3,8,6,16,12,9,32,24,18,64,5,48,36,27,128,10,96,72,54,256,20,192,15,144,108,81,512,40,384,30,288,216,162,1024
</pre>
<p>(One way to think about this may be that integers with higher <a href="http://planetmath.org/encyclopedia/NumberOfNondistinctPrimeFactorsFunction.html"><strong>Ω(n)</strong></a> should be relatively clustered around the origin).</p>
<p>(The sequence is listed as <a href="http://www.research.att.com/~njas/sequences/index.html?q=a168521&#038;language=english&#038;go=Search">OEIS A168521</a>).</p>
]]></content:encoded>
			<wfw:commentRss>http://quexotic.org/?feed=rss2&#038;p=46</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
