Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
27
Task/Pierpont-primes/Mathematica/pierpont-primes.math
Normal file
27
Task/Pierpont-primes/Mathematica/pierpont-primes.math
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
ClearAll[FindUpToMax]
|
||||
FindUpToMax[max_Integer, b_Integer] := Module[{res, num},
|
||||
res = {};
|
||||
Do[
|
||||
num = 2^u 3^v + b;
|
||||
If[PrimeQ[num], AppendTo[res, num]]
|
||||
,
|
||||
{u, 0, Ceiling@Log[2, max]}
|
||||
,
|
||||
{v, 0, Ceiling@Log[3, max]}
|
||||
];
|
||||
res //= Select[LessEqualThan[max]];
|
||||
res //= Sort;
|
||||
res
|
||||
]
|
||||
Print["Piermont primes of the first kind:"]
|
||||
Take[FindUpToMax[10^10, +1], UpTo[50]]
|
||||
Print["Piermont primes of the second kind:"]
|
||||
Take[FindUpToMax[10^10, -1], UpTo[50]]
|
||||
Print["250th Piermont prime of the first kind:"]
|
||||
Part[FindUpToMax[10^34, +1], 250]
|
||||
Print["250th Piermont prime of the second kind:"]
|
||||
Part[FindUpToMax[10^34, -1], 250]
|
||||
Print["1000th Piermont prime of the first kind:"]
|
||||
Part[FindUpToMax[10^130, +1], 1000]
|
||||
Print["1000th Piermont prime of the second kind:"]
|
||||
Part[FindUpToMax[10^150, -1], 1000]
|
||||
Loading…
Add table
Add a link
Reference in a new issue