• API
• FAQ
• Tools
• Archive
SHARE
TWEET

# Prime gaps asymptotic classification

MatsGranvik Aug 24th, 2018 (edited) 83 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
1. (*start*)
2. (*Mathematica*)
3. Clear[nn, h, n, k, m, d, dd];
4. nn = 20;
5. h = 2;(*twin primes*)N[
6.  Table[Sum[
7.    Sum[If[Mod[n, k] == 0,
8.       Sum[If[Mod[GCD[n/k, m], d] == 0, MoebiusMu[d]*(d), 0], {d, 1,
9.          GCD[n/k, m]}]*
10.        Sum[If[Mod[GCD[k, m + h], c] == 0, MoebiusMu[c]*(c), 0], {c, 1,
11.           GCD[k, m + h]}], 0], {k, 1, n}]/n, {n, 1,
12.     nn - h + 100}], {m, 1, nn - h}]];
13. N[Round[%, 10^-1]]
14. Table[N[If[n == 1, Log[nn - h + 100] + EulerGamma, MangoldtLambda[n]]*
15.     MangoldtLambda[n + h]], {n, 1, nn - h}];
16. N[Round[%, 10^-1]]
17.
18.
19. Clear[nn, h, n, k, m];
20. nn = 17;
21. h = 2;(*twin primes*)M4 =
22.  Table[Sum[
23.    Sum[If[Mod[n, k] == 0,
24.      Sum[If[Mod[GCD[n/k, m], d] == 0, MoebiusMu[d]*(d), 0], {d, 1,
25.         GCD[n/k, m]}]*
26.       Sum[If[Mod[GCD[k, m + h], c] == 0, MoebiusMu[c]*(c), 0], {c, 1,
27.         GCD[k, m + h]}], 0], {k, 1, n}], {m, 1, n}], {n, 1, nn - h}]
28.
29. Clear[nn, h, n, k, m];
30. nn = 17 + 2;
31. h = 4;(*Cousin primes*)M4 =
32.  Table[Sum[
33.    Sum[If[Mod[n, k] == 0,
34.      Sum[If[Mod[GCD[n/k, m], d] == 0, MoebiusMu[d]*(d), 0], {d, 1,
35.         GCD[n/k, m]}]*
36.       Sum[If[Mod[GCD[k, m + h], c] == 0, MoebiusMu[c]*(c), 0], {c, 1,
37.         GCD[k, m + h]}], 0], {k, 1, n}], {m, 1, n}], {n, 1, nn - h}]
38. (*end*)
39.
40. (*start*)
41. (*8 Feb 2019*)
42. TableForm[Table[
43.   h = 2^hh;
44.   nn = 82;
45.   TableForm[CC = Table[
46.      TableForm[
47.       A = Table[
48.         Table[If[Mod[n, k] == 0, MoebiusMu[k]/(k)^(0 - 1), 0], {k, 1,
49.           n}], {n, 1, nn}]];
50.      TableForm[
51.       B = Transpose[
52.         Table[Table[If[n >= k, A[[n, k]], 0], {k, 1, nn}], {n, 1,
53.           nn}]]];
54.      TableForm[
55.       AA = Table[
56.         Table[If[Mod[n, k] == 0, B[[n/k, m]], 0], {k, 1, nn}], {n, 1,
57.          nn}]];
58.      TableForm[
59.       BB = Table[
60.         Table[If[Mod[n, k] == 0, B[[n/k, m + h]], 0], {k, 1, nn}], {n,
61.           1, nn}]];
62.      (AA.BB)[[All, 1]], {m, 1, nn - h}]];
63.   Table[Sum[CC[[n, k]], {n, 1, k}], {k, 1, nn - h}], {hh, 1, 6}]]
64. (*end*)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.

Top