Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,28 @@
function Get-MersennePrime ([bigint]$Maximum = 4800)
{
[bigint]$n = [bigint]::One
for ($exp = 2; $exp -lt $Maximum; $exp++)
{
if ($exp -eq 2)
{
$s = 0
}
else
{
$s = 4
}
$n = ($n + 1) * 2 - 1
for ($i = 1; $i -le $exp - 2; $i++)
{
$s = ($s * $s - 2) % $n
}
if ($s -eq 0)
{
$exp
}
}
}

View file

@ -0,0 +1 @@
Get-MersennePrime | Format-Wide {"{0,4}" -f $_} -Column 4 -Force