Illustration of the Discrete Fourier Tranform DFT

Mathematica 8:

Do[
nn = i;
Print[MatrixForm[Transpose[Table[{1}, {n, 1, nn}]]]]
Print[MatrixForm[
Table[Table[Cos[-2*Pi*(n – 1)*(k – 1)/nn], {k, 1, nn}], {n, 1,
nn}]]]
Print[MatrixForm[
Chop[N[Table[
Total[Table[Cos[-2*Pi*(n – 1)*(k – 1)/nn], {k, 1, nn}]], {n, 1,
nn}]]]]]
, {i, 1, 12}]

Signal or time domain

\left(  \begin{array}{c}   1  \end{array}  \right)

Dicrete Fourier Cosine Transform

\left(  \begin{array}{c}   1  \end{array}  \right)

Spectrum or frequency domain

\left(  \begin{array}{c}   1.  \end{array}  \right)

Signal or time domain

\left(  \begin{array}{cc}   1 & 1  \end{array}  \right)

Dicrete Fourier Cosine Transform

\left(  \begin{array}{cc}   1 & 1 \\   1 & -1  \end{array}  \right)

Spectrum or frequency domain

\left(  \begin{array}{c}   2. \\   0.  \end{array}  \right)

Signal or time domain

\left(  \begin{array}{ccc}   1 & 1 & 1  \end{array}  \right)

Dicrete Fourier Cosine Transform

\left(  \begin{array}{ccc}   1 & 1 & 1 \\   1 & -\frac{1}{2} & -\frac{1}{2} \\   1 & -\frac{1}{2} & -\frac{1}{2}  \end{array}  \right)

Spectrum or frequency domain

\left(  \begin{array}{c}   3. \\   0. \\   0.  \end{array}  \right)

Signal or time domain

\left(  \begin{array}{cccc}   1 & 1 & 1 & 1  \end{array}  \right)

Dicrete Fourier Cosine Transform

\left(  \begin{array}{cccc}   1 & 1 & 1 & 1 \\   1 & 0 & -1 & 0 \\   1 & -1 & 1 & -1 \\   1 & 0 & -1 & 0  \end{array}  \right)

Spectrum or frequency domain

\left(  \begin{array}{c}   4. \\   0. \\   0. \\   0.  \end{array}  \right)

Signal or time domain

\left(  \begin{array}{ccccc}   1 & 1 & 1 & 1 & 1  \end{array}  \right)

Dicrete Fourier Cosine Transform

\left(  \begin{array}{ccccc}   1 & 1 & 1 & 1 & 1 \\   1 & \frac{1}{4} \left(-1+\sqrt{5}\right) & \frac{1}{4} \left(-1-\sqrt{5}\right) & \frac{1}{4} \left(-1-\sqrt{5}\right) & \frac{1}{4} \left(-1+\sqrt{5}\right) \\   1 & \frac{1}{4} \left(-1-\sqrt{5}\right) & \frac{1}{4} \left(-1+\sqrt{5}\right) & \frac{1}{4} \left(-1+\sqrt{5}\right) & \frac{1}{4} \left(-1-\sqrt{5}\right) \\   1 & \frac{1}{4} \left(-1-\sqrt{5}\right) & \frac{1}{4} \left(-1+\sqrt{5}\right) & \frac{1}{4} \left(-1+\sqrt{5}\right) & \frac{1}{4} \left(-1-\sqrt{5}\right) \\   1 & \frac{1}{4} \left(-1+\sqrt{5}\right) & \frac{1}{4} \left(-1-\sqrt{5}\right) & \frac{1}{4} \left(-1-\sqrt{5}\right) & \frac{1}{4} \left(-1+\sqrt{5}\right)  \end{array}  \right)

Spectrum or frequency domain

\left(  \begin{array}{c}   5. \\   0. \\   0. \\   0. \\   0.  \end{array}  \right)

Signal or time domain

\left(  \begin{array}{cccccc}   1 & 1 & 1 & 1 & 1 & 1  \end{array}  \right)

Dicrete Fourier Cosine Transform

\left(  \begin{array}{cccccc}   1 & 1 & 1 & 1 & 1 & 1 \\   1 & \frac{1}{2} & -\frac{1}{2} & -1 & -\frac{1}{2} & \frac{1}{2} \\   1 & -\frac{1}{2} & -\frac{1}{2} & 1 & -\frac{1}{2} & -\frac{1}{2} \\   1 & -1 & 1 & -1 & 1 & -1 \\   1 & -\frac{1}{2} & -\frac{1}{2} & 1 & -\frac{1}{2} & -\frac{1}{2} \\   1 & \frac{1}{2} & -\frac{1}{2} & -1 & -\frac{1}{2} & \frac{1}{2}  \end{array}  \right)

Spectrum or frequency domain

\left(  \begin{array}{c}   6. \\   0. \\   0. \\   0. \\   0. \\   0.  \end{array}  \right)

Signal or time domain

\left(  \begin{array}{ccccccc}   1 & 1 & 1 & 1 & 1 & 1 & 1  \end{array}  \right)

Dicrete Fourier Cosine Transform

\left(  \begin{array}{ccccccc}   1 & 1 & 1 & 1 & 1 & 1 & 1 \\   1 & \text{Sin}\left[\frac{3 \pi }{14}\right] & -\text{Sin}\left[\frac{\pi }{14}\right] & -\text{Cos}\left[\frac{\pi }{7}\right] & -\text{Cos}\left[\frac{\pi }{7}\right] & -\text{Sin}\left[\frac{\pi }{14}\right] & \text{Sin}\left[\frac{3 \pi }{14}\right] \\   1 & -\text{Sin}\left[\frac{\pi }{14}\right] & -\text{Cos}\left[\frac{\pi }{7}\right] & \text{Sin}\left[\frac{3 \pi }{14}\right] & \text{Sin}\left[\frac{3 \pi }{14}\right] & -\text{Cos}\left[\frac{\pi }{7}\right] & -\text{Sin}\left[\frac{\pi }{14}\right] \\   1 & -\text{Cos}\left[\frac{\pi }{7}\right] & \text{Sin}\left[\frac{3 \pi }{14}\right] & -\text{Sin}\left[\frac{\pi }{14}\right] & -\text{Sin}\left[\frac{\pi }{14}\right] & \text{Sin}\left[\frac{3 \pi }{14}\right] & -\text{Cos}\left[\frac{\pi }{7}\right] \\   1 & -\text{Cos}\left[\frac{\pi }{7}\right] & \text{Sin}\left[\frac{3 \pi }{14}\right] & -\text{Sin}\left[\frac{\pi }{14}\right] & -\text{Sin}\left[\frac{\pi }{14}\right] & \text{Sin}\left[\frac{3 \pi }{14}\right] & -\text{Cos}\left[\frac{\pi }{7}\right] \\   1 & -\text{Sin}\left[\frac{\pi }{14}\right] & -\text{Cos}\left[\frac{\pi }{7}\right] & \text{Sin}\left[\frac{3 \pi }{14}\right] & \text{Sin}\left[\frac{3 \pi }{14}\right] & -\text{Cos}\left[\frac{\pi }{7}\right] & -\text{Sin}\left[\frac{\pi }{14}\right] \\   1 & \text{Sin}\left[\frac{3 \pi }{14}\right] & -\text{Sin}\left[\frac{\pi }{14}\right] & -\text{Cos}\left[\frac{\pi }{7}\right] & -\text{Cos}\left[\frac{\pi }{7}\right] & -\text{Sin}\left[\frac{\pi }{14}\right] & \text{Sin}\left[\frac{3 \pi }{14}\right]  \end{array}  \right)

Spectrum or frequency domain

\left(  \begin{array}{c}   7. \\   0 \\   0 \\   0 \\   0 \\   0 \\   0  \end{array}  \right)

Posted in Uncategorized | Comments Off on Illustration of the Discrete Fourier Tranform DFT

Dirichlet character sums for the terms of the von Mangoldt function

\sum _{n=1}^{\infty } (1 \chi _{1,1}(n)+0)

\log(2) = \sum _{n=1}^{\infty } (2 \chi _{2,1}(n)-1)

\log(3) = \sum _{n=1}^{\infty } (3 \chi _{3,1}(n)-2)

\log(2) = \sum _{n=1}^{\infty } (2 \chi _{4,1}(n)-1)

\log(5) = \sum _{n=1}^{\infty } (5 \chi _{5,1}(n)-4)

\log(1) = \sum _{n=1}^{\infty } (2 \chi _{2,1}(n)-1) (3 \chi _{3,1}(n)-2)

\log(7) = \sum _{n=1}^{\infty } (7 \chi _{7,1}(n)-6)

\log(2) = \sum _{n=1}^{\infty } (2 \chi _{8,1}(n)-1)

\log(3) = \sum _{n=1}^{\infty } (3 \chi _{9,1}(n)-2)

\log(1) = \sum _{n=1}^{\infty } (2 \chi _{2,1}(n)-1) (5 \chi _{5,1}(n)-4)

\log(11) = \sum _{n=1}^{\infty } (11 \chi _{11,1}(n)-10)

\log(1) = \sum _{n=1}^{\infty } (4 \chi _{4,1}(n)-1) (3 \chi _{3,1}(n)-2)

Posted in Uncategorized | Comments Off on Dirichlet character sums for the terms of the von Mangoldt function

The fundamental theorem of arithmetic is encoded by the von Mangoldt function

Mathematica 8

A = Table[
Table[If[Mod[n, k] == 0, Exp[MangoldtLambda[n/k]], ""], {k, 1,
12}], {n, 1, 12}];
MatrixForm[A]

\left(  \begin{array}{cccccccccccc}   1 & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} \\   2 & 1 & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} \\   3 & \text{} & 1 & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} \\   2 & 2 & \text{} & 1 & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} \\   5 & \text{} & \text{} & \text{} & 1 & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} \\   1 & 3 & 2 & \text{} & \text{} & 1 & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} \\   7 & \text{} & \text{} & \text{} & \text{} & \text{} & 1 & \text{} & \text{} & \text{} & \text{} & \text{} \\   2 & 2 & \text{} & 2 & \text{} & \text{} & \text{} & 1 & \text{} & \text{} & \text{} & \text{} \\   3 & \text{} & 3 & \text{} & \text{} & \text{} & \text{} & \text{} & 1 & \text{} & \text{} & \text{} \\   1 & 5 & \text{} & \text{} & 2 & \text{} & \text{} & \text{} & \text{} & 1 & \text{} & \text{} \\   11 & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & 1 & \text{} \\   1 & 1 & 2 & 3 & \text{} & 2 & \text{} & \text{} & \text{} & \text{} & \text{} & 1  \end{array}  \right)

Row products of the matrix above are the natural numbers.

Posted in Uncategorized | Comments Off on The fundamental theorem of arithmetic is encoded by the von Mangoldt function

Agreement between summatory von Mangoldt function and partial sums of von Mangoldt matrix

Image

Edit 14.10.2012: Unfortunately copy pasting into wordpress makes the code show wrong, and it will not work.

Mathematica 8

aa = 32;
a = Range[aa]*0;
Monitor[Do[
T[n_, k_] :=
T[n, k] =
If[n < 1 || k n, T[k, n],
If[n > k, T[k, Mod[n, k, 1]], -Sum[T[n, i], {i, n – 1}]]]]];
A = Table[Table[T[n, k]/n, {n, 1, nn}], {k, 1, nn}];
A[[1, All]] = 0;
a[[nn]] = Total[Total[A]], {nn, 1, aa}], nn]
b = a;
c = Accumulate[Table[N[MangoldtLambda[n]], {n, 1, aa}]];
g2 = ListPlot[{c, b}, ImageSize -> Full]

Link to Pastebin with working code:
von Mangoldt function and von Mangoldt matrix

Posted in Uncategorized | Comments Off on Agreement between summatory von Mangoldt function and partial sums of von Mangoldt matrix

Fourier transform of the von Mangoldt function with first term equal to a harmonic number

(*Mathematica 8*)

Clear[f]
scale = 100000;
f = ConstantArray[0, scale];
f[[1]] = N@HarmonicNumber[scale];
Monitor[Do[
f[[i]] = N@MangoldtLambda[i] + f[[i - 1]], {i, 2, scale}], i]
xres = .002;
xlist = Exp[Range[0, Log[scale], xres]];
tmax = 60;
tres = .015;
Monitor[errList =
Table[(xlist^(-1/2 + I t).(f[[Floor[xlist]]] - xlist)), {t,
Range[0, 60, tres]}];, t]
ListLinePlot[Im[errList]/Length[xlist], DataRange -> {0, 60},
PlotRange -> {-.02, .15}, Frame -> True, Axes -> False]

Image

Posted in Uncategorized | Comments Off on Fourier transform of the von Mangoldt function with first term equal to a harmonic number

Zeta zero approximations

7 \pi -\text{Log}\left[\frac{7}{2} e^{-7 \pi /2}+\frac{5}{2} e^{-5 \pi /2}+\frac{3}{2} e^{-3 \pi /2}+e^{5 \pi /2}+2 \pi \right]

9 \pi -\text{Log}\left[-3 e^{\pi /2}-3 e^{2 \pi /2}-e^{3 \pi /2}+3 e^{4 \pi /2 }\right]

11 \pi -\text{Log}\left[-1+3 e^{4 \pi /2}+e^{6 \pi /2}\right]

13 \pi -\text{Log}\left[2-e^{\pi /2}+3 e^{2 \pi /2}+2 e^{3 \pi /2}+2 e^{4 \pi /2}-2 e^{5 \pi /2}+3 e^{6 \pi /2}\right]

15 \pi -\text{Log}\left[1-e^{\pi /2}+e^{2 \pi /2}-4 e^{3 \pi /2}+2 e^{4 \pi /2}+5 e^{5 \pi /2}+e^{7 \pi /2}+e^{9 \pi /2}\right]

In[447]:= N[
7*Pi – Log[
2*Pi + Exp[5/2*Pi] + 3/2*Exp[-3/2*Pi] + 5/2*Exp[-5/2*Pi] +
7/2*Exp[-7/2*Pi]], 90]
7*Pi – Log[
2*Pi + Exp[5/2*Pi] + 3/2*Exp[-3/2*Pi] + 5/2*Exp[-5/2*Pi] +
7/2*Exp[-7/2*Pi]]
N[9*Pi – Log[
Exp[4/2*Pi]*3 – Exp[3/2*Pi] – Exp[2/2*Pi]*3 – Exp[1/2*Pi]*3], 90]
9*Pi – Log[Exp[4/2*Pi]*3 – Exp[3/2*Pi] – Exp[2/2*Pi]*3 – Exp[1/2*Pi]*3]
N[11*Pi – Log[Exp[6/2*Pi] + Exp[4/2*Pi]*3 – 1], 90]
11*Pi – Log[Exp[6/2*Pi] + Exp[4/2*Pi]*3 – 1]
N[13*Pi –
Log[Exp[6/2*Pi]*3 – Exp[5/2*Pi]*2 + Exp[4/2*Pi]*2 + Exp[3/2*Pi]*2 +
Exp[2/2*Pi]*3 – Exp[1/2*Pi] + 2], 90]
13*Pi – Log[
Exp[6/2*Pi]*3 – Exp[5/2*Pi]*2 + Exp[4/2*Pi]*2 + Exp[3/2*Pi]*2 +
Exp[2/2*Pi]*3 – Exp[1/2*Pi] + 2]
N[15*Pi –
Log[Exp[9/2*Pi] + Exp[7/2*Pi] + Exp[5/2*Pi]*5 + Exp[4/2*Pi]*2 –
Exp[3/2*Pi]*4 + Exp[2/2*Pi] – Exp[1/2*Pi] + Exp[0/2*Pi]], 90]
15*Pi – Log[
Exp[9/2*Pi] + Exp[7/2*Pi] + Exp[5/2*Pi]*5 + Exp[4/2*Pi]*2 –
Exp[3/2*Pi]*4 + Exp[2/2*Pi] – Exp[1/2*Pi] + Exp[0/2*Pi]]

Out[447]= \
14.1347251415462971625332949457130250888808428761125331718801906227734\
522626031127266673111

Out[448]=
7 \[Pi] –
Log[7/2 E^(-7 \[Pi]/2) + 5/2 E^(-5 \[Pi]/2) + 3/2 E^(-3 \[Pi]/2) +
E^(5 \[Pi]/2) + 2 \[Pi]]

Out[449]= \
21.0220647317531170031433976766645381602165975607485034136361666286850\
112342614339440360907

Out[450]=
9 \[Pi] –
Log[-3 E^(\[Pi]/2) – 3 E^\[Pi] – E^(3 \[Pi]/2) + 3 E^(2 \[Pi])]

Out[451]= \
25.0109121181194454425895620012384712403356051145851908039782928528267\
355833273049906375471

Out[452]= 11 \[Pi] – Log[-1 + 3 E^(2 \[Pi]) + E^(3 \[Pi])]

Out[453]= \
30.4248954527601648230070306069243251177298536494717015917080755061626\
004025280687729937055

Out[454]=
13 \[Pi] –
Log[2 – E^(\[Pi]/2) + 3 E^\[Pi] + 2 E^(3 \[Pi]/2) + 2 E^(2 \[Pi]) –
2 E^(5 \[Pi]/2) + 3 E^(3 \[Pi])]

Out[455]= \
32.9350618199689987097953015374911208470972884058585555099783653166032\
622776454859421331614

Out[456]=
15 \[Pi] –
Log[1 – E^(\[Pi]/2) + E^\[Pi] – 4 E^(3 \[Pi]/2) + 2 E^(2 \[Pi]) +
5 E^(5 \[Pi]/2) + E^(7 \[Pi]/2) + E^(9 \[Pi]/2)]

Posted in Uncategorized | Comments Off on Zeta zero approximations

inverted von Mangoldt function plot as sum of cosines


Clear[nn, k, n, a, res];
res = 100;
Monitor[a =
N[Table[Sum[
MangoldtLambda[n]*1/n*
Sum[Cos[-nn*(k - 1)/n*2*Pi], {k, 1, n}], {n, 1, nn}], {nn, 1,
res, 1/res}]];, N[nn]]
g1 = ListLinePlot[a, DataRange -> {1, res}];
Show[g1, ImageSize -> Full]

Image

Posted in Uncategorized | Comments Off on inverted von Mangoldt function plot as sum of cosines

Twelve digits

N[Log[2/3*Exp[-5/2*Pi] + Exp[7*Pi – Log[7/2*Exp[-7/2*Pi] + 5/2*Exp[-5/2*Pi] + 3/2*Exp[-3/2*Pi] + Exp[5/2*Pi] + 2*Pi]]], 15]
N[Im[ZetaZero[1]], 15]

14.1347251417344…
14.1347251417347…

Posted in Uncategorized | Comments Off on Twelve digits

Periodic sequences from cosine sums.

Mathematica:

In[292]:= len = 24;
nn = 1;
Table[Sum[Cos[n*(k – 1)/nn*2*Pi], {k, 1, nn}], {n, 1, len}]
nn = 2;
Table[Sum[Cos[n*(k – 1)/nn*2*Pi], {k, 1, nn}], {n, 1, len}]
nn = 3;
Table[Sum[Cos[n*(k – 1)/nn*2*Pi], {k, 1, nn}], {n, 1, len}]
nn = 4;
Table[Sum[Cos[n*(k – 1)/nn*2*Pi], {k, 1, nn}], {n, 1, len}]

Out[294]= {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
1, 1, 1, 1, 1}

Out[296]= {0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, \
2, 0, 2, 0, 2}

Out[298]= {0, 0, 3, 0, 0, 3, 0, 0, 3, 0, 0, 3, 0, 0, 3, 0, 0, 3, 0, \
0, 3, 0, 0, 3}

Out[300]= {0, 0, 0, 4, 0, 0, 0, 4, 0, 0, 0, 4, 0, 0, 0, 4, 0, 0, 0, \
4, 0, 0, 0, 4}

In[301]:= len = 24;
nn = 1;
Table[n/nn^2*Sum[Cos[n*(k – 1)/nn*2*Pi], {k, 1, nn}], {n, 1, len}]
nn = 2;
Table[n/nn^2*Sum[Cos[n*(k – 1)/nn*2*Pi], {k, 1, nn}], {n, 1, len}]
nn = 3;
Table[n/nn^2*Sum[Cos[n*(k – 1)/nn*2*Pi], {k, 1, nn}], {n, 1, len}]
nn = 4;
Table[n/nn^2*Sum[Cos[n*(k – 1)/nn*2*Pi], {k, 1, nn}], {n, 1, len}]

Out[303]= {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, \
18, 19, 20, 21, 22, 23, 24}

Out[305]= {0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0, 8, 0, 9, 0, \
10, 0, 11, 0, 12}

Out[307]= {0, 0, 1, 0, 0, 2, 0, 0, 3, 0, 0, 4, 0, 0, 5, 0, 0, 6, 0, \
0, 7, 0, 0, 8}

Out[309]= {0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 4, 0, 0, 0, \
5, 0, 0, 0, 6}

Posted in Uncategorized | Comments Off on Periodic sequences from cosine sums.

Dirichlet series converging to zero

Mathematica


Clear[j, a1, cc, OnePlusB, n, dd, a]
OnePlusB = (1 + N[Sum[(-1)^j*(3*j)^(-1/2), {j, 1, Infinity}], 120])
a1 = N[Sum[
1/Sqrt[i] - 1/Sqrt[1 + i] - 2/Sqrt[2 + i] - 1/Sqrt[3 + i] + 1/Sqrt[
4 + i] + 2/Sqrt[5 + i], {i, 1, \[Infinity], 6}], 500]
Monitor[cc = Table[a1*OnePlusB^n, {n, 0, 1000000}];, n]
dd = 2 + Total[cc]
a1 = N[Sum[
1/Sqrt[i] - 1/Sqrt[1 + i] - dd/Sqrt[2 + i] - 1/Sqrt[3 + i] + 1/
Sqrt[4 + i] + dd/Sqrt[5 + i], {i, 1, \[Infinity], 6}], 500]

Dirichlet series converging to zero

Posted in Uncategorized | Comments Off on Dirichlet series converging to zero