Re: Maxima - computing number of components in M-set



adam majewski schrieb:
Hi

I'm trying to compute number of components for given period
of mandelbrot set . See:
http://republika.pl/fraktal/mset_components.html

My code is :
=================
N(p):=
if p=1
then 2^(p-1)
else if primep(p)
then 2^(p-1)-1
else block
(
[d:divisors(p)],
[l:length(d)],
[array[s,l]],
for i:0 thru l-2 step 1 do
block(
s[i]:N(first(d)),
display(s[i]),
d:delete(first(d),d)
),
b:sum(s[j],j,0,l-2),
display(b),
return(2^(p-1)-b)
);

===========================================
It works good for prime numbers or 1, but for composite number it works
only for 4. For 8 it gives 126 but should 120.
I see that line:
b:sum(s[j],j,0,l-2)
does not give proper result, but I don't know why.
Can you tell me why ?

Regards

Adam Majewski

Hi Adam,

It is late in the night in germany and my brain doesn't manage any more
for-loops, indices starting at 0 and deleting elements from sets - sorry.
Therefore I do not understand, why the value of b is wrong, but as long as my
tired eyes are not completely shut, I think your code shall do the same as

N(p):=
if p=1
then 1
else 2^(p-1) - apply("+",map(N,listify(disjoin(p,divisors(p))))) $

does:

map(N,makelist(i,i,1,16));

[1,1,3,6,15,27,63,120,252,495,1023,2010,4095,8127,16365,32640]

Peter
.



Relevant Pages

  • Re: M-set: from internal angles to external
    ... Are the same but in opposite directions from the x axis with center offset (behave like the y sign). ... What might help you to understand the dynamics is the Joukowski cylinder flow used in analysis of air flow about wings in aerodynamics. ... The Mandelbrot set is topologically a cylinder. ... Adam Majewski ...
    (sci.fractals)
  • Maxima - computing number of components in M-set
    ... of mandelbrot set. ... It works good for prime numbers or 1, but for composite number it works ... does not give proper result, ... Adam Majewski ...
    (sci.math.symbolic)