No BSD License
-
Fibonacci(n)
Fibonacci.m by David Terr, Raytheon, 5-11-04
-
GeneralizedFibonacci(n,a,b)
GeneralizedFibonacci.m by David Terr, Raytheon, 10-20-04
-
GeneralizedLucas(n,a,b)
GeneralizedLucas.m by David Terr, Raytheon, 10-20-04
-
JacobiSymbol(a,b)
Compute the Jacobi symbol (a/b), where a and b are integers with b odd and positive.
-
Lucas(n)
Fibonacci.m by David Terr, Raytheon, 5-11-04
-
MinkowskiQM(x)
Given x from 0 to 1, compute the Minkowski question mark function of x.
-
Pell(d,s,n)
-
QCF(d,u,v,quiet)
-
RoundQCF(d,u,v,quiet)
-
binomial(n,m)
binomial.m by David Terr, Raytheon, 5-11-04
-
cfrac(x,n)
-
factor2( n )
-
fromcfrac( a )
Return the number whose continued fraction coefficieints are given as a row or column vector.
-
harmonic(z)
harmonic.m by David Terr, Raytheon, 9-10-04
-
partitiontable(n)
PartitionTable.m by David Terr, Raytheon, 6-7-04
-
qftimes(f1,f2)
qftimes.m by David Terr, Raytheon, 11-17-04
-
roundcfrac(x,n)
-
rqf(f)
-
sigma(k,n)
-
tau(n)
-
partitionplot.m
-
View all files
from
numerical.zip
by David Terr
Archive containing numerical function files.
|
| tau(n)
|
% tau by David Terr, Raytheon Inc., 5-19-04
% Given a nonnegative integer n, return tau(n), where tau is the Ramanujan
% tau function, defined as the coefficient of x^n in the Taylor expansion of
% x * prod_{k>=1}(1-x^k)^24. tau(n) has some fascinating number theoretic
% properties.
% Note: This program requires first downloading factor2 and sigma.
function t = tau(n)
if n==0
t = 0;
return;
end
if n==1
t = 1;
return;
end
if n==2
t = -24;
return;
end
if isprime(n)==1
m = (n-1)/2;
s5os5 = zeros(1,m);
for k=1:m
s5os5(k) = sigma(5,k)*sigma(5,n-k);
end
t = (65 * sigma(11,n) + 691 * (sigma(5,n) - 504*sum(s5os5))) / 756;
else
fax = factor2(n);
len = length(fax(:,1));
p = fax(1,1);
if len==1 % n is a prime power
t = tau(p) * tau(n/p) - p^11 * tau(n/p^2);
return;
else
e = fax(1,2);
q = p^e;
t = tau(q) * tau(n/q);
return;
end
end
t = round(t);
|
|
Contact us at files@mathworks.com