Mandelbrot Set

The Mandelbrot set is created from this very simple formula in which both Z and C are complex numbers. The formula is iterated to determine whether Z is bounded or tends to infinity.  To demonstrate this assume a test case where the imaginary part is zero and focus just on the real part.  In this case, the formula is trivial to evaluate starting with Z = 0.  The table below shows the outcome at C=0.2 and C=0.3 and where one is clearly bounded and the other is not! Iteration C = 0.2 C = 0.3 0 0 1 0.2 0.3 2 0.24 0.39 3 0.2576 0.4521 4 0.266358 0.504394 5 0.270946 0.554414 6 0.273412 0.607375 7 0.274754 0.668904 8 0.27549 0.747432 9 0.275895 0.858655 10 0.276118 1.037289 11 0.276241 1.375968…
Read More

Narcissistic Numbers

I heard about these on BBC Radio 4 More or Less and they just intrigued me, perhaps in part because they have no know application! In the past similar obsessions have appeared with the calculation of PI and right back to my childhood calculating powers of 2 on a BBC Micro! The full definition, as for everything, is on Wikipedia but in short a narcissistic number is one where the sum of the digits raised to the power of the number of digits equals the number itself. For example, 153 = 1^3 + 5^3 + 3^3. Here's some quick and dirty Perl code to calculate them: use strict; use warnings; for (my $i = 0; $i < 10000; $i++) { my $pwr = length($i); my $total = 0; for (my $j =…
Read More