A recent thread on r/math brought the arithmetic derivative to my attention. It’s a very interesting idea. As I tried to rap my head around it, I wished I had a graph of its actions on some of the natural numbers. So I made one:
Posts Tagged ‘sage’
Arithmetic Derivative Graph and Thoughts
April 11, 20113D printing of Mathematical Objects!
August 21, 2010
Back in the fall I did some work on getting hacklab.to‘s 3d-printer to print mathematical objects created in sage. Unfortunately, shortly after I got it to work and printed a test sphere, the 3d printer broke. Thus began a long succession of the makerbot — nicknamed the break-r-bot — being fixed and broken… spending most of its time broken.
But recently it was fixed and I decided to dig out my old code and get to work on it.
Gamma Fractals
February 12, 2010There doesn’t seem to have been much done in the way of studying fractals of iterated functions involving gamma. At least nothing that I could find.
So I started playing around with it. It’s a bit difficult to work with as sage (4.3.2) keeps crashing when I try to plot it (try to run complex_plot(gamma(gamma(x)), [-10,10], [-10,10]) or complex_plot(gamma(gamma(gamma(x))), [-5,5], [-5,5]) ), but I still got some pictures…

Fractals with non-Integer powers
February 11, 2010I mess around with fractals a lot, and sometimes stumble on some interesting things. Recently I came across some odd jagged/discontinuous fractals:

This tends to happen in fractals as soon as I involved non-Integer powers.
Why is this happening? To understand this, we need to look at some basic complex analysis.
Recall that a complex number can be interpreted as a vector like . But we can also think if a vector in terms of direction and magnitude. For our purposes, we will think of vectors as a magnitude and an angle from the positive portion of the real number line (sometimes called the `argument,’ we will just call it the angle).
Complex numbers have the interesting property that when we multiply them their magnitudes multiply like normal numbers but their angles add. For example, has an angle of
so when we multiply two of them we end up with a magnitude of
and an angle of
and thus
.
When we raise a value to a real power, the angle is multiplied by that value. We can visualise this as:
![]() |
![]() |
It’s fairly clear that for the inverse, for any value, there are two valid answers.
![]() |
![]() ![]() |
We can also look at it with an alternative visualisation I just cooked up:
Notice that the angle of the ray of discontinuity is arbitrary, but its existence is inevitable.
(For more on complex analysis, I recommend Visual Complex Analysis by Tristan Needham (Google Books, Amazon). It’s awesome!)
(Sage users: Here is a generalised version of the function I used to make the above image. It takes a value n and returns a visualisation of the nth root:
def root_visualize(n): l=[] for j in range(n*8): l.append(complex_plot(lambda x: (x*exp(-sqrt(-1)*j*pi/4))^(1/n)*exp(sqrt(-1)*j*pi/n/4),[-5,5],[-5,5])) print j return animate(l)
Be warned: it is slow)
Now, notice that is the same as
. Thus, it has the same discontinuity. That seems like a reasonable answer to “why is this so jagged?”
But it leads to some interesting questions. The intuitive reaction is (for me at least): part of the fractal is missing. You’re cutting apart the nice, smooth mutlifunction and thus are only seeing part of the fractal. Well, at iterations there
possible ways to have cut this hypothetical super-fractal (as I will refer to it).
Let’s look at the Julia super-fractal of for four iterations…
If you stare at all the possibilities of the forming set you will notice some patterns and what look like reciprocals and other patterns. One may intuitively wish to add them to extract a single fractal, but this isn’t possible since they’d cancel… Perhaps adding the absolute values?
(For more on the formation of fractals, see my previous post.)
Of course, one really should look at a larger number of iterations than I am. There is the small problem of this being , but it should be easy to parallelize…
So that’s the extent that I’ve explored this to so far. I’d be thrilled to get some feedback. Do you have any thoughts about this? Know of similar things that have been studied? (I’ve never formally studied Chaos Theory and suspect I have lots of holes in my knowledge. Reminder to self: take/audit course on chaos theory next year…)
Formation of Escape-Time Fractals
December 19, 2009We’ve all seen images of escape-time fractals. But have you ever wondered how they form? I was playing around with sage‘s complex_plot function and got some interesting images…
For reference, here is the identity function (notice that it is also the zeroth iteration: ).
Mandelbrot Set Example
Recall that the definition of the Mandelbrot set is . (If this is notation confuses you, you may wish to refer to my previous post on anonymous functions.)
(equivalent to
)
(equivalent to
)
(equivalent to
)
(equivalent to
)
(equivalent to
)
(equivalent to
)
(equivalent to
)
(equivalent to
)
-
(equivalent to
)
(equivalent to
)
-
Julia Set of 0.3 Example
- We can do this with other fractals. Recall that the Julia Set of
is defined as
.
(equivalent to
)
(equivalent to
)
(equivalent to
)
(equivalent to
)
- And so on…
- Update:
- Here is a far more developed and higher resolution image of the Julia set of 0.3.I don’t know what the red is.
- Here is a animation of the transition of generalised Mandelbrot set from the power of -4 to 4, inspired by this Youtube video:
-
Update 2:
Here are animations of the forming Mandlebrot set and Julia set respectivly: