Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  generateCANFACT.g   Sprache: unbekannt

 
Spracherkennung für: .g vermutete Sprache: Unknown {[0] [0] [0]} [Methode: Schwerpunktbildung, einfache Gewichte, sechs Dimensionen]

##############################################################################
##
#A  generateCANFACT.g                                             Frank Lübeck
##
##  This file can be read by GAP to produce an update of the list 'CANFACT' in
##  'CANFACT.g'. For example after an update of the list of Brent factors, see
##  '?FetchMoreFactors'.
##  
##  The idea is to fork GAP instances which try for 5 seconds to factorize p^n
##  - 1. If successful the pair (p,n) is included in CANFACT.
##


SetInfoLevel( InfoPrimeInt, 0 );
out := OutputTextFile("CANFACT", false);
SetPrintFormattingStatus(out, false);
AppendTo(out, "CANFACT := [];\n");
for p in Filtered([1..10000], IsPrime)  do
  Print(p," [\c");
  if p < 10 then
    max := 2000;
  elif p < 100 then 
    max := 500;
  else 
    max := 100;
  fi;
  AppendTo(out, "CANFACT[",p,"]:=[];\n");
  l := [];
  for n in [1..max] do
    Print([p,n]," \c");
    pf := ParTakeFirstResultByFork([Factors],[[p^n-1]],
          rec(TimeOut:=rec(tv_sec:=5,tv_usec:=0)));
    if Length(pf) > 0 then
      AppendTo(out, "Add(CANFACT[",p,"],",n,");\n");
    fi;
  od;
od;
CloseStream(out);
Print("""Read the file 'CANFACT' and print the variable CANFACT to the file
    CANFACT.g
to store the data more compactly.
""");




[Dauer der Verarbeitung: 0.12 Sekunden, vorverarbeitet 2026-06-17]

                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik