append_factors.pl 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #!/usr/bin/perl
  2. use 5.014;
  3. use Math::GMPz;
  4. use ntheory qw(forsemiprimes forprimes factor forsquarefree random_prime divisors gcd);
  5. use Math::Prime::Util::GMP qw(mulint is_pseudoprime vecprod divint sqrtint);
  6. # 3274782926266545
  7. # 4788772759754985
  8. # 633708839387221385771985
  9. # 85866492509341408342261785
  10. # 1153582279094600286115568385
  11. # 38049785538164232203093987265
  12. # 9239040473268653691499587195465
  13. # 55428474928216449147566945330865
  14. # 304740732375157335714579744005385
  15. my $n = "3470207934739664512679701940114447720865";
  16. forprimes {
  17. #if ($_ % 80 == 9) {
  18. #if ($_ % 2 == 1 and $_ > 1) {
  19. if (is_pseudoprime(mulint($n, $_), 2)) {
  20. say mulint($n, $_);
  21. }
  22. #~ my ($p, $q) = factor($_);
  23. #~ $n = Math::GMPz->new($n);
  24. #~ if ($n % $p == 0) {
  25. #~ if (is_pseudoprime(($n/$p)*$q, 2)) {
  26. #~ say (($n/$p)*$q);
  27. #~ }
  28. #~ }
  29. #~ if ($n % $q == 0) {
  30. #~ if (is_pseudoprime(($n/$q)*$p, 2)) {
  31. #~ say (($n/$q)*$p);
  32. #~ }
  33. #~ }
  34. # }
  35. } 1e8;
  36. __END__