Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/GAP/pkg/utils/tst/   (GAP Algebra Version 4.15.1©)  Datei vom 11.8.2025 mit Größe 2 kB image not shown  

Quelle  number.tst   Sprache: unbekannt

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

#@local  i, iter, n, p, sum

##############################################################################
##
#W  number.tst                 Utils Package                       Stefan Kohl
##
#Y  Copyright (C) 2015-2022, The GAP Group
##  

gap> ReadPackage( "utils", "tst/loadall.g" );;
gap> UtilsLoadingComplete;
true

## SubSection 4.1.1 
gap> AllSmoothIntegers( 31000 );
123468912161824273236485464728196
  108128144162192216243256288324384432486512576
  648729768864972 ]
gap> AllSmoothIntegers( [5,11,17], 1000 );
151117255585121125187275289425605625935 ]
gap> Length( last );
16
gap> List( [3..20], n -> Length( AllSmoothIntegers( [5,11,17], 10^n ) ) );
162950781141552122823594525656918319921173
  137415951843 ]

## SubSection 4.1.2 
gap> AllProducts([1..4],3); 
123424683691248121624684812
  166121824816243236912612182491827
  36122436484812168162432122436481632
  4864 ]
gap> Set(last);            
1234689121618242732364864 ]
gap> AllProducts( [(1,2,3),(2,3,4)], 2 );
[ (2,4,3), (1,2)(3,4), (1,3)(2,4), (1,3,2) ]

## SubSection 4.1.3 
gap> RestrictedPartitions( 20, [4..10] );
[ [ 44444 ], [ 5555 ], [ 6554 ], [ 6644 ], 
  [ 7544 ], [ 776 ], [ 8444 ], [ 866 ], [ 875 ], 
  [ 884 ], [ 965 ], [ 974 ], [ 1055 ], [ 1064 ], 
  [ 1010 ] ]
gap> RestrictedPartitionsWithoutRepetitions( 20, [4..10] );
[ [ 1064 ], [ 974 ], [ 965 ], [ 875 ] ]
gap> RestrictedPartitionsWithoutRepetitions( 10^2, List([1..10], n->n^2 ) );
[ [ 100 ], [ 6436 ], [ 49251691 ] ]

## SubSection 4.1.4 
gap> n := 2^251;;
gap> NextProbablyPrimeInt( n );
3618502788666131106986593281521497120414687020801267626233049500247285301313

## SubSection 4.1.6 
gap> iter := PrimeNumbersIterator();;
gap> for i in [1..100] do  p := NextIterator(iter);  od;
gap> p;
541
gap> sum := 0;;
gap> ## "prime number race" 1 vs. 3 mod 4
gap> for p in PrimeNumbersIterator() do 
>       if p <> 2 then sum := sum + E(4)^(p-1); fi;
>       if sum > 0 then break; fi;
>    od;
gap> p;
26861 

## this final example takes quite a while: use examples/number.g 
## gap> sum := 0;;
## gap> ## "prime number race" 1 vs. 5 mod 8
## gap> for p in PrimeNumbersIterator() do 
## >       if p mod 8 in [1,5] then sum := sum + E(4)^((p-1)/2); fi;
## >       if sum > 0 then break; fi;
## >    od;
## gap> p;
## 588067889

#############################################################################
##
#E  number.tst  . . . . . . . . . . . . . . . . . . . . . . . . . . ends here

[Dauer der Verarbeitung: 0.15 Sekunden, vorverarbeitet 2026-06-07]