-
Notifications
You must be signed in to change notification settings - Fork 0
/
lucas-carmichael_where_gpf(n)-1|n-1_cached.pl
executable file
·77 lines (67 loc) · 2.09 KB
/
lucas-carmichael_where_gpf(n)-1|n-1_cached.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/usr/bin/perl
# Find Lucas-Carmichael numbers m such that gpf(m)-1 divides m-1, where gpf(n) is the greatest prime factor of n.
use 5.020;
use strict;
use warnings;
use Storable;
use Math::GMPz;
use ntheory qw(:all);
use Math::Prime::Util::GMP;
use experimental qw(signatures);
my $storable_file = "cache/factors-lucas-carmichael.storable";
my $table = retrieve($storable_file);
foreach my $key (sort { log($a) <=> log($b) } keys %$table) {
my $n = Math::GMPz->new($key);
my $nm1 = $n - 1;
if (Math::GMPz::Rmpz_divisible_p($nm1, Math::GMPz->new((split(' ', $table->{$key}))[-1]) - 1)) {
say $n;
}
}
__END__
# Large terms
55333499786988788735
63908863725136096799
222492139904510148959
247945654704315692159
383136386666013614879
701293164739659686039
712608221098634484239
2227380138191708413199
2616432535620177748319
4363165519328721092399
6496978862508209268479
7528378858876486724399
18065514730369066803359
26504929362821014498679
111298108046889941195759
357003507439753410993119
1945519707216382165632959
11906260042032845244188279
408703806209126216272841279
1359479289384309091807955159
1748546772534604289508614639
49688766185045519758770829439
164239014755303103783565952399
199176254044607763407344064399
552768565621467954842547493679
581346719419473034172593630559
620504996493512587468081328999
882521915656299454811036442239
1977848905455865311181233354719
2113105299854479590215630779319
11833463635694995090329797533919
46503718811202398669473431494879
883365031220312389291982911699919
13046104502838610619944087863962399
139958696078065035109449635406890399
2234058365461416908764667377125935519
325364458600983576255744358844340424559
1743859916486942820437842382161666571759
1891105659381286213430254667759106591839
36141432337665204689417522761925228734199
52708896904783934855815874404340752522079
713869914438719291658843790341460855460999
30929869681595566326223026143547237768574058684159
157700896136019588908390412927666058161615233665199
4990988897305070637150645943011389856433518467959586548799
180739644243274795122612378477503056744811039770137982278520020707039