mersenneforum.org  

Go Back   mersenneforum.org > Fun Stuff > Puzzles

Reply
 
Thread Tools
Old 2023-02-06, 00:49   #67
alpertron
 
alpertron's Avatar
 
Aug 2002
Buenos Aires, Argentina

152210 Posts
Default

I have not seen the links to the files sorted by exponent because it is linked at the bottom of the exports page. I only saw the links to the files ordered by date, which are not useful for us.

Maybe in the future I will perform a double check.
alpertron is offline   Reply With Quote
Old 2023-02-11, 00:52   #68
alpertron
 
alpertron's Avatar
 
Aug 2002
Buenos Aires, Argentina

2×761 Posts
Default

I changed the program to use the data from https://www.mersenne.ca/export/

Code:
#!/usr/bin/perl
use Math::BigInt lib => 'GMP';

$solutionsFound = 0;
$candidates = 0;
$sumInverses = 0;
$fh = 0;
# Use Gray codes to generate all composite factors.
sub generateFactors
{
  my $expon = $_[0];
  my @factors = @{$_[1]};
  my $factorLen = @factors;
  my $square = $expon * $expon;
  my $currReducedFactor = 0;
  my $currFactor;
  my $factorNbr = 0;
  my $grayCode = 0;
  my $factor;
  my @reducedFactors = ();
  for (my $index = 0; $index < $factorLen; $index++)
  {
    @reducedFactors[$index] = @factors[$index] -> copy() -> bmod($expon) -> numify();
    if ($index < $factorLen - 1)
    {
      @reducedFactors[$index] *= 2;
    }
  }
  $sumInverses += (2 ** $factorLen - 1)/ $expon;
  do
  {
    $factorNbr++;
    #Get lowest non-zero bit number.
    my $currBit = 1;
    my $bitNbr = 0;
    my $temp = $factorNbr;
    my $output;
    while ($temp % 2 == 0)
    {
      $temp = $temp / 2;
      $bitNbr++;
      $currBit *= 2;
    }
    return if ($bitNbr == $factorLen);
    $candidates++;
    $grayCode = $grayCode ^ $currBit;
    if ($grayCode & $currBit)
    {
      $currReducedFactor += @reducedFactors[$bitNbr];
    }
    else
    {
      $currReducedFactor -= @reducedFactors[$bitNbr];
    }
    if (($currReducedFactor % $expon) == 0)
    {   # Solution found. Find factor for solution.
      $currFactor = Math::BigInt->bone();   ## One.
      $currBit = 1;
      if ($grayCode & (2 ** ($factorLen-1)))
      {         ## Using cofactor.
        for ($bitNbr = 0; $bitNbr < $factorLen - 1; $bitNbr++)
        {
          if (($grayCode & $currBit) == 0)
          {
            $factor = @factors[$bitNbr] -> copy() -> bmul(2*$expon) -> binc();
            $currFactor -> bmul($factor);
          }
          $currBit *= 2;
        }
        if ($expon > 2000)
        {
          if ($currFactor == 1)
          {
            print "$expon, 2^$expon-1\n";
            print $fh "$expon, 2^$expon-1\n";
          }
          else
          {
            $output = $currFactor -> bstr();
            print "$expon, (2^$expon-1)/$output\n";
            print $fh "$expon, (2^$expon-1)/$output\n";
          }
        }
        else
        {
          # Compute $currFactor = (2**$expon - 1)/$currFactor.
          my $temp = Math::BigInt->new(2);
          $temp -> bpow($expon) -> bdec() -> bdiv($currFactor);
          $currFactor = $temp;
          $output = $currFactor -> bstr();
          print "$expon, $output\n";
          print $fh "$expon, $output\n";
        }          
      }
      else
      {
        for ($bitNbr = 0; $bitNbr < $factorLen; $bitNbr++)
        {
          if ($grayCode & $currBit)
          {
            $factor = @factors[$bitNbr] -> copy() -> bmul(2*$expon) -> binc();
            $currFactor -> bmul($factor);
          }
          $currBit *= 2;
        }
        print "$expon, $currFactor\n";
        print $fh "$expon, $currFactor\n";
      }
      $solutionsFound++;
      select()->flush();
    }
  } while (1);
}

open($fh, '>', "factors.txt") or die $!;
my $currExp = -1;
my @factors = ();
my $nbrElems = 0;
for ($fileNbr = 0; $fileNbr <= 9; $fileNbr++)
{
  open(my $inputFile, '<', "mersenneca_known_factors_${fileNbr}G.txt") or die $!;
  while (my $line = <$inputFile>)
  {
    if ($line =~ /^(\d+),(\d+)$/gm)
    {    ## $1 = Exponent, $2 = k.
      if ($1 != $currExp)
      {
        if (int($1/1000000) != int($currExp/1000000))
        {
          print "Exponent = $currExp, found: $solutionsFound, candidates: $candidates, sum inverses: $sumInverses\n";
          select()->flush();
        }
        if ($currExp > 1)
        {
          ## add (cofactor mod currExp^2) / currExp to array.
          my $bigExp = Math::BigInt->new($currExp);
          my $bigSquare = $bigExp -> copy() -> bmul($bigExp);
          my $base = Math::BigInt->new(2);
          my $cofactor = $base -> copy() -> bmodpow($currExp, $bigSquare);
            # cofactor = ((2^currExp - 1) mod currExp^2) / currExp
          $cofactor->bdec() -> bdiv($currExp) -> bmod($currExp);
          for (my $index = 0; $index < $nbrElems; $index++)
          {
            my $reducedFactor = @factors[$index] -> copy() -> bmod($currExp) -> bmul(2);
            $cofactor = $cofactor -> bsub($reducedFactor);
          }
          $factors[$nbrElems] = $cofactor -> copy();  ## Add cofactor to array.
          generateFactors($currExp, \@factors);
        }
        $currExp = $1;
        @factors = ();
        $nbrElems = 0;
      }
      $factors[$nbrElems] = Math::BigInt->new($2);    ## Save value of k = (factor-1)/2/exponent.
      $nbrElems++;
    }
  }
  close($inputFile);
}
close($fh);
print "Exponent = $currExp, found: $solutionsFound, candidates: $candidates, sum inverses: $sumInverses\n";
select()->flush();
After almost 20 hours I found the same 22 solutions in the range 0G - 1G and no solutions in the range 1G - 10G using the data updated on 5 Feb.

In the range 1G - 10G there were 873352250 candidates and the sum of inverses was 0.257388, so the probability of finding a solution with 10-digit exponent was a little higher than 25%.
alpertron is offline   Reply With Quote
Old 2023-03-07, 04:22   #69
alpertron
 
alpertron's Avatar
 
Aug 2002
Buenos Aires, Argentina

2×761 Posts
Default

I'm running PRP for M281903623/known factors. It just passed the iteration #100 million.
Attached Thumbnails
Click image for larger version

Name:	M281903623.png
Views:	66
Size:	21.9 KB
ID:	28102  
alpertron is offline   Reply With Quote
Old 2023-04-06, 22:59   #70
alpertron
 
alpertron's Avatar
 
Aug 2002
Buenos Aires, Argentina

101111100102 Posts
Default

A few hours ago it passed iteration #200 million:
Attached Thumbnails
Click image for larger version

Name:	Iteration 200 million.png
Views:	54
Size:	20.2 KB
ID:	28222  

Last fiddled with by alpertron on 2023-04-06 at 23:00
alpertron is offline   Reply With Quote
Old 2023-04-30, 21:47   #71
alpertron
 
alpertron's Avatar
 
Aug 2002
Buenos Aires, Argentina

2×761 Posts
Default

As expected, the number M281903623 / known factors is composite.

It appears that the server does not accept the proof file.

The last iterations are:
Attached Thumbnails
Click image for larger version

Name:	Last iterations.png
Views:	26
Size:	34.0 KB
ID:	28314  
alpertron is offline   Reply With Quote
Old 2023-05-01, 07:56   #72
Dobri
 
"ม้าไฟ"
May 2018

22·7·19 Posts
Default

Quote:
Originally Posted by alpertron View Post
As expected, the number M281903623 / known factors is composite.

It appears that the server does not accept the proof file.
...
An alternative option is to try the PRP Proof Manual Upload at https://www.mersenne.org/proof_upload_manual/.
Dobri is offline   Reply With Quote
Old 2023-05-01, 12:31   #73
alpertron
 
alpertron's Avatar
 
Aug 2002
Buenos Aires, Argentina

2·761 Posts
Default

PrimeNet rejects the proof file as shown below:
Attached Thumbnails
Click image for larger version

Name:	Not proof.png
Views:	30
Size:	8.6 KB
ID:	28317  
alpertron is offline   Reply With Quote
Old 2023-05-01, 12:46   #74
Andrew Usher
 
Dec 2022

5×7×13 Posts
Default

Congratulations!

But it's unfortunate that a bad proof might spoil it. That does not seem to be one of the stronger points of our system. Here Prime95 actually stated it generated a valid proof, but it is corrupt.
Andrew Usher is offline   Reply With Quote
Old 2023-05-01, 12:55   #75
alpertron
 
alpertron's Avatar
 
Aug 2002
Buenos Aires, Argentina

2·761 Posts
Default

At least the Gerbicz tests every million iterates were all OK.
alpertron is offline   Reply With Quote
Old 2023-05-01, 20:24   #76
kriesel
 
kriesel's Avatar
 
"TF79LL86GIMPS96gpu17"
Mar 2017
US midwest

170718 Posts
Default

Quote:
Originally Posted by Dobri View Post
An alternative option is to try the PRP Proof Manual Upload at https://www.mersenne.org/proof_upload_manual/.
This seems to indicate it is for PRP tests (not also for PRP-CF). Probably worth a try once though, to try to save a PRP-CF-DC on such a large exponent.
"Here you can upload .proof files from PRP tests. Internet-connected Prime95/mprime machines should not need this (they will upload proof files automatically) but gpuowl users (for example) need to upload proof files manually. Prior to uploading a proof file you need to submit the JSON result for the PRP test. If you don't see your PRP test listed below your upload will not be accepted." (No version of Gpuowl to date does PRP-CF.)
There are several proof file uploader possibilities, listed at https://www.mersenneforum.org/showpo...0&postcount=26. Those are for PRP-test proof files too, but possibly one might work for PRP-CF proof. If the file is not flawed in some fatal way. Which it apparently is, since mprime / prime95 didn't work on it.

@alpertron: Save the proof file a while, in case Prime95 wants to examine a copy for what's wrong. Occasionally he's able to resolve such a problem for a high-effort file, uploading it successfully, and may even find a program bug or opportunity to reduce the occurrence of such issues.

Last fiddled with by kriesel on 2023-05-01 at 20:25
kriesel is offline   Reply With Quote
Old 2023-05-01, 21:14   #77
alpertron
 
alpertron's Avatar
 
Aug 2002
Buenos Aires, Argentina

152210 Posts
Default

I was able to upload the proof file using the uploader.exe linked from https://mersenneforum.org/showpost.p...3&postcount=14
alpertron is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
factors of Mersenne numbers bhelmes Number Theory Discussion Group 21 2021-09-15 02:07
Mersenne factors 2*k*p+1 ATH Miscellaneous Math 7 2020-10-09 11:09
factors of Mersenne numbers bhelmes Miscellaneous Math 8 2020-09-14 17:36
Distribution of Mersenne Factors tapion64 Miscellaneous Math 21 2014-04-18 21:02
Known Mersenne factors CRGreathouse Math 5 2013-06-14 11:44

All times are UTC. The time now is 01:25.


Sun Jun 11 01:25:56 UTC 2023 up 296 days, 22:54, 0 users, load averages: 0.73, 0.70, 0.79

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.

≠ ± ∓ ÷ × · − √ ‰ ⊗ ⊕ ⊖ ⊘ ⊙ ≤ ≥ ≦ ≧ ≨ ≩ ≺ ≻ ≼ ≽ ⊏ ⊐ ⊑ ⊒ ² ³ °
∠ ∟ ° ≅ ~ ‖ ⟂ ⫛
≡ ≜ ≈ ∝ ∞ ≪ ≫ ⌊⌋ ⌈⌉ ∘ ∏ ∐ ∑ ∧ ∨ ∩ ∪ ⨀ ⊕ ⊗ 𝖕 𝖖 𝖗 ⊲ ⊳
∅ ∖ ∁ ↦ ↣ ∩ ∪ ⊆ ⊂ ⊄ ⊊ ⊇ ⊃ ⊅ ⊋ ⊖ ∈ ∉ ∋ ∌ ℕ ℤ ℚ ℝ ℂ ℵ ℶ ℷ ℸ 𝓟
¬ ∨ ∧ ⊕ → ← ⇒ ⇐ ⇔ ∀ ∃ ∄ ∴ ∵ ⊤ ⊥ ⊢ ⊨ ⫤ ⊣ … ⋯ ⋮ ⋰ ⋱
∫ ∬ ∭ ∮ ∯ ∰ ∇ ∆ δ ∂ ℱ ℒ ℓ
𝛢𝛼 𝛣𝛽 𝛤𝛾 𝛥𝛿 𝛦𝜀𝜖 𝛧𝜁 𝛨𝜂 𝛩𝜃𝜗 𝛪𝜄 𝛫𝜅 𝛬𝜆 𝛭𝜇 𝛮𝜈 𝛯𝜉 𝛰𝜊 𝛱𝜋 𝛲𝜌 𝛴𝜎𝜍 𝛵𝜏 𝛶𝜐 𝛷𝜙𝜑 𝛸𝜒 𝛹𝜓 𝛺𝜔