[Edu-sig] Idle play

Kirby Urner urnerk at qwest.net
Fri Apr 29 07:49:35 CEST 2005


Exciting, the new Python books in the pipe line.

I've got an article on hypertoons queued, giving Pyzine first dibs.

Just got off the phone with my friend Koski, a Fuller Schooler in
Minneapolis.  He was showing me some fun cartoons for cubing.

Option 1:

Consider a penny all alone (=1), then surrounded by a layer of six (=7
total), then surround by another layer of 12 (=19 total) and so on.  Each
consecutive layer is the next multiple of 6, always this growing hexagon.

Now stack consecutive hexagons.  You get this "Christmas Tree" with one ball
to start at the top, then a layer of 7 below that, then 19, 37, 61... each
of greater girth (hence the tree allusion), and always centered around a
vertical spine or trunk of pennies (or marbles).

Adding n consecutive layers of this Christmas Tree gives n**3.

In Python:

 >>> def hex(n):
         """ Hexagon """
	   return 1 + sum([6*i for i in range(n)]) # i goes 0..(n-1)

 >>> [hex(x) for x in range(1,10)]  # to David: x goes 1..9, 10 excluded
 >>> [1, 7, 19, 37, 61, 91, 127, 169, 217]


 >>> def tree(n):
         """ Stack of Hexagons """
	   return sum([hex(i) for i in range(1,n+1)]) # to n this time

 >>> [tree(x) for x in range(1,10)]
 [1, 8, 27, 64, 125, 216, 343, 512, 729]

i.e. consecutive cubes.

Option 2:

Another way David talked about, to get cubes:

n**3 = 6 * Tetra + n where Tetra is a tetrahedral number 0,1,4,10,20,35...

We looked up Tetra here:

http://www.research.att.com/cgi-bin/access.cgi/as/njas/sequences/eisA.cgi?An
um=A000292

So...

 >>> def tetra(n):
         """ Tetrahedral numbers, with n=1 giving 0, n=2 giving 1... """
	   return ((n-1)*(n)*(n+1))/6

 >>> [tetra(x) for x in range(1,10)]
 [0, 1, 4, 10, 20, 35, 56, 84, 120]

 >>> def cube(n):
        """ n**3 - n is 6 times a tetrahedral number """
	  return 6*tetra(n) + n

 >>> [cube(n) for n in range(1,10)]
 [1, 8, 27, 64, 125, 216, 343, 512, 729]

This is idle yet creative play, not super deep math, but still good
exercise.  

An interactive shell makes it fun/accessible.  

Having geometric cartoons on the side, to show the trees, hexagons,
tetrahedral, would add to the experience, to where eventually the
imagination could take over (David has a good imagination).

Kirby




More information about the Edu-sig mailing list