Möbius function identity

x=7; // size of matrix
T=zeros(x,x);

// Value for first element
T(1,1)=1;
T(2,1)=1; // can be any number except 0

// Values for first column
for n=3:x;
T(n,1)=rand(); //random number
end

// Values for second column
for n=2:x;
T(n,2)=T(n,1)-T(n-1,2);
end

// Values for the table from the third column onwards
for n=3:x;
for k=3:n;
s = 0;
for i=1:k-1; 
//recursive definition of divisibility without using the mod function 
s=s+T(n-i,k-1)-T(n-i,k);
end
T(n,k)=s;
end
end
T

A=inv(T)
// Mats Granvik, email: mats.granvik(AT)abo.fi
Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.