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

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

Logarithmic square root waves

Mathematica


Clear[A, B, n, k, T, nn]
nn = 100;
Monitor[A =
Table[Table[N[Re[k^ZetaZero[n]], 12], {k, 1, nn}], {n, 1, nn}];, n]
ArrayPlot[A, ImageSize -> Full]

logarithmic square root waves

Posted in Uncategorized

von Mangoldt function and Riemann zeta zeros

Mathematica


Clear[A, B, n, k, T, nn]
nn = 24;

A = Table[Table[N[Re[k^ZetaZero[n]], 12], {k, 1, nn}], {n, 1, nn}];

MatrixForm[A]
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}]]]]];

B = Table[Table[T[n, k]/n, {k, 1, nn}], {n, 1, nn}];

MatrixForm[B]
Total[A]
Total[N[B, 10]]

Posted in Uncategorized

Mertens function

Mathematica


nn = 1000
Monitor[aa =
Table[Sum[MoebiusMu[k]*Floor[n/k]^(0), {k, 1, n}], {n, 1, nn}];, n]
Monitor[bb =
Table[Sum[MoebiusMu[k]*Floor[n/k]^(1/2), {k, 1, n}], {n, 1, nn}];,
n + 1000]
Monitor[cc = Table[(6/Pi^2)*n^(1/2), {n, 1, nn}];, n + 2000]
ListLinePlot[{aa, bb, -cc, bb + 2*cc - 2*cc[[1]], cc},
ImageSize -> Full]

Print["These are equal:"]
Clear[t];
nn = 12;
rowsumexponent = 1/2;
t[n_, k_] :=
t[n, k] =
If[n = k, t[Floor[n/k], 1]]]]];
MatrixForm[Table[Table[t[n, k], {k, 1, 12}], {n, 1, 12}]];
gg = Table[t[n, 1], {n, 1, 12}];
dd = Table[
Sum[MoebiusMu[k]*Floor[n/k]^(rowsumexponent), {k, 1, n}], {n, 1,
nn}];
MatrixForm[Transpose[{gg, dd, dd - gg}]]

Print["But unfortunately these are not equal:"]
Clear[t];
nn = 12;
rowsumexponent = 1/2;
t[n_, k_] :=
t[n, k] =
If[n = k, t[Floor[n/k], 1]]]]];
MatrixForm[Table[Table[t[n, k], {k, 1, 12}], {n, 1, 12}]];
gg = Table[t[n, 1], {n, 1, 12}];
dd = (6/Pi^2)*
Table[Sum[MoebiusMu[k]*Floor[n/k]^(rowsumexponent), {k, 1, n}], {n,
1, nn}];
MatrixForm[Transpose[{gg, dd, dd - gg}]]

Mertens function in the middle

Posted in Uncategorized

Zeta zero spectrum with spikes of similar heights

Mathematica


Clear[f]
scale = 1000000;
f = Range[scale];

f[[1]] = N@MangoldtLambda[1];
Monitor[Do[
f[[i]] = N@MangoldtLambda[i] + f[[i - 1]], {i, 2, scale}], i]

xres = .004;
xlist = Exp[Range[0, Log[scale - 1], xres]];
tmax = 60;
tres = .015;
s = 1/2;
Monitor[errList1 =
Table[(Total[(xlist^(-1/2 + I t)*(f[[Floor[xlist]]] -
xlist))])*(-1/2 + I t), {t, 0, tmax, tres}];, t]

Print["Variant of the Fourier transform of the von Mangoldt function"]
g1 = ListLinePlot[Re[errList1]/Length[xlist], DataRange -> {0, tmax},
PlotRange -> {-.3, 1.3}, Axes -> True, Filling -> Axis];
g2 = Graphics[Line[{{0, 1}, {tmax, 1}}]];
Show[g1, g2, ImageSize -> Large]

Posted in Uncategorized

Primes as zeros of polynomials

If the code below doesn’t work this code at Pastebin should work:

prime number polynomials

Mathematica:


Clear[nn, t, n, k, M, x];
nn = 100;
t[n_, 1] = 1;
t[1, k_] = 1;
t[n_, k_] :=
t[n, k] =
If[n 1, k > 1], x - Sum[t[k - i, n], {i, 1, n - 1}], 0],
If[And[n > 1, k > 1], x - Sum[t[n - i, k], {i, 1, k - 1}], 0]];
M = Table[Table[t[n, k], {k, 1, nn}], {n, 1, nn}];
MatrixForm[M];
Plot[{Log[Det[M]], -Log[-Det[M]]}, {x, 0, nn}, Filling -> Axis,
ImageSize -> Large]
Det[M]

{2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, \
67, 71, 73, 79, 83, 89, 97}

-1863421930771874888093773332480000 \
(128531325300505565894745960580688308974372099421200497637265827559438\
70293633488281250 x^39 -
2330685263101519033233198809849133175771996846016601671526733419271\
70681098298410546875 x^40 +
2056313035804526365475585334709278064828195426812628689049033481854\
586112381843468046875 x^41 -
1176282071573845344602877452001020300880714950288283589185372631383\
3066624521515113890625 x^42 +
4905000734024499696664833528882178331290639767887896665901405607830\
6745240014110059559375 x^43 -
1589371761302150018933790038374660192514118745354272295493103910328\
41906747589444827207500 x^44 +
4165931283662198580801769016212968686473503870625636598822998595394\
34610765052095643685500 x^45 -
9078896923826708550125778634112303749252146500492477711668801612316\
16602142661809542205900 x^46 +
1678144342383082231818092247764138029904145792906833059787377321899\
086975719185511661862600 x^47 -
2670617372253432019724728565759894321133041526935410272332691296354\
449403157830634344730062 x^48 +
3701955046681015256677898368288149581096465045410847548523517763851\
726509324822108523663790 x^49 -
4511198816093594162055201299220594719654079786973187794666832078885\
109535482082426178150298 x^50 +
4868779477170994901165053136487157697400486051278377582782822813608\
424755966095438173927150 x^51 -
4682147134555877773794814354656826970457784804297844863473455413286\
480141678587741633991508 x^52 +
4032062543587948270009807154260865001346806849222738076321674269446\
462419132213132504442260 x^53 -
3122121415128518167146096368172154616034972474420245684465319013394\
806595018152467392257532 x^54 +
2181151852107457973027094328625543369526768776822034362213803544175\
363666859894519638586450 x^55 -
1378636369688362970070147918857505659137119641806760147950411847272\
554459640154629370726685 x^56 +
7901961050440498036384995452268708649601155231691431594450024905586\
00442613068864741536925 x^57 -
4114757332397062339192869466619963169701784549229177005577809815180\
91595733950709464628215 x^58 +
1949454319454895575111076053201305912599159270737618825843195250086\
87087499161325325265025 x^59 -
8412543005411648588185951509306119734464102812016596077997625577506\
5055109296982980823520 x^60 +
3309312236694501086534612449733965242441775821938481399484637258278\
0392153364745056450000 x^61 -
1187329919991294613185354795215040242732861087306876136438924977014\
8584649384566743603080 x^62 +
3886336471236370774115479273169128132055685468643257456137922054706\
168020191349338908400 x^63 -
1160510089917061690749077988219257563973691532927796038812069604394\
578612724163323429860 x^64 +
3160813303753949689427103825792147523671089722844939210960527054970\
69032192780902795300 x^65 -
7848633640984627740444703272367678034446639073942297701096067765852\
0730122719320032140 x^66 +
1775595224742109556609200652821082543923554450769034452535704970034\
2428149535049341700 x^67 -
3656506828102765372736536458851858840712756560181056228401302014777\
802239990541120456 x^68 +
6846837825833178152193893293378314658469990722275192526030986802647\
63666015194546120 x^69 -
1164278647870503078643126094960010094429820380383962567520105825819\
29640334987715224 x^70 +
1795249560789507057771769584731583122144757623291186665535386776362\
6404781415889350 x^71 -
2505936498239667134585125019390672089656977317772283927009636329603\
501009026551589 x^72 +
3160755336306214533526815060559253183465956379512946375782658690394\
25552572604805 x^73 -
3595104553985762377552526415844870095406826478003283786766985827448\
6328430583231 x^74 +
3679485718228405638601224913239487397476409550113386307245500220776\
400624938625 x^75 -
3380721203885104569833143312548607029656558693233736707742576714192\
83793018540 x^76 +
2781715707222874228150276906057731192923790736345435808794572843345\
5143232700 x^77 -
2044471074534013324486140679745468361110609444529044840034752845115\
370342460 x^78 +
1338605505235063898332979704402862180161164510536187422119879832568\
15440600 x^79 -
7786190020601854220912010187624769126805281463858566223233215329151\
597230 x^80 +
4011945036396925253597569095495407292223928417484087622447942654249\
48750 x^81 -
1825806220101512224177692450377783684561414124243294847038620834022\
6170 x^82 +
7316118884283563311076345356139383865567639410335628027659219484903\
50 x^83 -
2572852857313525659475063938913017111091064128667264211005473510794\
0 x^84 + 7912875802489843170611070602464904473578606992019678618764217\
77700 x^85 -
21201615299221853511337960328136709456973154234391017214971495660 \
x^86 + 492769589122601905729494504089945116900958343031880054962466950\
x^87 – 9885583598609559524771431565638672182317197847495799641052707 \
x^88 + 170177552251535200900516303252122207976759798530432292607715 \
x^89 – 2496188124199763708650512408749700269031221473162512891753 \
x^90 + 30927328130861848559154204639122357962577222538024135375 x^91 \
– 320120742971841859237129827569212530968005055259797928 x^92 +
2728884973041339081915263455382563439947495036861560 x^93 -
18795246928633888788577116615408259300443354857712 x^94 +
101840302721019792953400417571639466806960906800 x^95 -
417371413712099062811233049949627582960297600 x^96 +
1214713683680341509046777775829337072800000 x^97 -
2234891933753665252501477478978277120000 x^98 +
1952335327213263997342642816512000000 x^99)

Posted in Uncategorized